refactor(web): asset grid stores (#3464)

* Refactor asset grid stores

* Iterate over buckets with for..of loop

* Rebase on top of main branch changes
This commit is contained in:
Sergey Kondrikov
2023-08-01 04:27:56 +03:00
committed by GitHub
parent 13051c1e5a
commit 5f9dfa9493
15 changed files with 330 additions and 265 deletions

View File

@@ -25,10 +25,12 @@
import { flip } from 'svelte/animate';
import { onDestroy, onMount } from 'svelte';
import { browser } from '$app/environment';
import { isViewingAssetStoreState } from '$lib/stores/asset-interaction.store';
import { assetViewingStore } from '$lib/stores/asset-viewing.store';
export let data: PageData;
let { isViewing: showAssetViewer } = assetViewingStore;
// The GalleryViewer pushes it's own history state, which causes weird
// behavior for history.back(). To prevent that we store the previous page
// manually and navigate back to that.
@@ -48,7 +50,7 @@
});
const handleKeyboardPress = (event: KeyboardEvent) => {
if (!$isViewingAssetStoreState) {
if (!$showAssetViewer) {
switch (event.key) {
case 'Escape':
goto(previousRoute);