Update timeline
This commit is contained in:
@@ -20,6 +20,7 @@
|
|||||||
import ThemeButton from '../shared-components/theme-button.svelte';
|
import ThemeButton from '../shared-components/theme-button.svelte';
|
||||||
import { shouldIgnoreShortcut } from '$lib/utils/shortcut';
|
import { shouldIgnoreShortcut } from '$lib/utils/shortcut';
|
||||||
import { mdiFileImagePlusOutline, mdiFolderDownloadOutline } from '@mdi/js';
|
import { mdiFileImagePlusOutline, mdiFolderDownloadOutline } from '@mdi/js';
|
||||||
|
import UpdatePanel from '../shared-components/update-panel.svelte';
|
||||||
|
|
||||||
export let sharedLink: SharedLinkResponseDto;
|
export let sharedLink: SharedLinkResponseDto;
|
||||||
export let user: UserResponseDto | undefined = undefined;
|
export let user: UserResponseDto | undefined = undefined;
|
||||||
@@ -167,4 +168,6 @@
|
|||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
</AssetGrid>
|
</AssetGrid>
|
||||||
|
<UpdatePanel {assetStore} />
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
@@ -413,6 +413,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</Portal>
|
</Portal>
|
||||||
|
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
#asset-grid {
|
#asset-grid {
|
||||||
contain: layout;
|
contain: layout;
|
||||||
|
|||||||
@@ -1,21 +1,25 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { websocketStore } from '$lib/stores/websocket';
|
import { websocketStore } from '$lib/stores/websocket';
|
||||||
import { AssetStore } from '$lib/stores/assets.store';
|
import type { AssetStore } from '$lib/stores/assets.store';
|
||||||
import { notificationController, NotificationType } from './notification/notification';
|
import { notificationController, NotificationType } from './notification/notification';
|
||||||
|
|
||||||
let assetStore = new AssetStore(/* vos options ici */);
|
|
||||||
let assetUpdateCount = 0;
|
|
||||||
let lastAssetName;
|
|
||||||
let timeoutId;
|
|
||||||
|
|
||||||
const subscribe = websocketStore.onAssetUpdate.subscribe(value => {
|
export let assetStore: AssetStore | null;
|
||||||
if (value && value.originalFileName) {
|
let assetUpdateCount = 0;
|
||||||
lastAssetName = value.originalFileName;
|
let lastAssetName: string;
|
||||||
|
let timeoutId: string | number | NodeJS.Timeout | undefined;
|
||||||
|
|
||||||
|
websocketStore.onAssetUpdate.subscribe(asset => {
|
||||||
|
if (asset && asset.originalFileName && assetStore) {
|
||||||
|
lastAssetName = asset.originalFileName;
|
||||||
assetUpdateCount++;
|
assetUpdateCount++;
|
||||||
|
|
||||||
assetStore.updateAsset(value);
|
assetStore.updateAsset(asset,true);
|
||||||
|
|
||||||
clearTimeout(timeoutId);
|
assetStore.removeAsset(asset.id); // Update timeline
|
||||||
|
assetStore.addAsset(asset);
|
||||||
|
|
||||||
|
clearTimeout(timeoutId);
|
||||||
timeoutId = setTimeout(() => {
|
timeoutId = setTimeout(() => {
|
||||||
if (assetUpdateCount === 1) {
|
if (assetUpdateCount === 1) {
|
||||||
|
|
||||||
|
|||||||
@@ -58,6 +58,7 @@
|
|||||||
import ActivityStatus from '$lib/components/asset-viewer/activity-status.svelte';
|
import ActivityStatus from '$lib/components/asset-viewer/activity-status.svelte';
|
||||||
import { numberOfComments, setNumberOfComments, updateNumberOfComments } from '$lib/stores/activity.store';
|
import { numberOfComments, setNumberOfComments, updateNumberOfComments } from '$lib/stores/activity.store';
|
||||||
import AlbumOptions from '$lib/components/album-page/album-options.svelte';
|
import AlbumOptions from '$lib/components/album-page/album-options.svelte';
|
||||||
|
import UpdatePanel from '$lib/components/shared-components/update-panel.svelte';
|
||||||
|
|
||||||
export let data: PageData;
|
export let data: PageData;
|
||||||
|
|
||||||
@@ -754,3 +755,5 @@
|
|||||||
on:save={({ detail: description }) => handleUpdateDescription(description)}
|
on:save={({ detail: description }) => handleUpdateDescription(description)}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
<UpdatePanel {assetStore} />
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
import { AssetStore } from '$lib/stores/assets.store';
|
import { AssetStore } from '$lib/stores/assets.store';
|
||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
import { mdiPlus, mdiDotsVertical } from '@mdi/js';
|
import { mdiPlus, mdiDotsVertical } from '@mdi/js';
|
||||||
|
import UpdatePanel from '$lib/components/shared-components/update-panel.svelte';
|
||||||
|
|
||||||
export let data: PageData;
|
export let data: PageData;
|
||||||
|
|
||||||
@@ -52,3 +53,4 @@
|
|||||||
/>
|
/>
|
||||||
</AssetGrid>
|
</AssetGrid>
|
||||||
</UserPageLayout>
|
</UserPageLayout>
|
||||||
|
<UpdatePanel {assetStore} />
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
import { AssetStore } from '$lib/stores/assets.store';
|
import { AssetStore } from '$lib/stores/assets.store';
|
||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
import { mdiDotsVertical, mdiPlus } from '@mdi/js';
|
import { mdiDotsVertical, mdiPlus } from '@mdi/js';
|
||||||
|
import UpdatePanel from '$lib/components/shared-components/update-panel.svelte';
|
||||||
|
|
||||||
export let data: PageData;
|
export let data: PageData;
|
||||||
|
|
||||||
@@ -57,3 +58,4 @@
|
|||||||
/>
|
/>
|
||||||
</AssetGrid>
|
</AssetGrid>
|
||||||
</UserPageLayout>
|
</UserPageLayout>
|
||||||
|
<UpdatePanel {assetStore} />
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
import { onDestroy } from 'svelte';
|
import { onDestroy } from 'svelte';
|
||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
import { mdiPlus, mdiArrowLeft } from '@mdi/js';
|
import { mdiPlus, mdiArrowLeft } from '@mdi/js';
|
||||||
|
import UpdatePanel from '$lib/components/shared-components/update-panel.svelte';
|
||||||
|
|
||||||
export let data: PageData;
|
export let data: PageData;
|
||||||
|
|
||||||
@@ -45,4 +46,5 @@
|
|||||||
</ControlAppBar>
|
</ControlAppBar>
|
||||||
{/if}
|
{/if}
|
||||||
<AssetGrid {assetStore} {assetInteractionStore} />
|
<AssetGrid {assetStore} {assetInteractionStore} />
|
||||||
|
<UpdatePanel {assetStore} />
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
import { assetViewingStore } from '$lib/stores/asset-viewing.store';
|
import { assetViewingStore } from '$lib/stores/asset-viewing.store';
|
||||||
import { mdiDotsVertical, mdiPlus } from '@mdi/js';
|
import { mdiDotsVertical, mdiPlus } from '@mdi/js';
|
||||||
|
import UpdatePanel from '$lib/components/shared-components/update-panel.svelte';
|
||||||
|
|
||||||
export let data: PageData;
|
export let data: PageData;
|
||||||
|
|
||||||
@@ -97,3 +98,4 @@
|
|||||||
/>
|
/>
|
||||||
</AssetGrid>
|
</AssetGrid>
|
||||||
</UserPageLayout>
|
</UserPageLayout>
|
||||||
|
<UpdatePanel {assetStore} />
|
||||||
@@ -23,6 +23,7 @@
|
|||||||
import empty3Url from '$lib/assets/empty-3.svg';
|
import empty3Url from '$lib/assets/empty-3.svg';
|
||||||
import ConfirmDialogue from '$lib/components/shared-components/confirm-dialogue.svelte';
|
import ConfirmDialogue from '$lib/components/shared-components/confirm-dialogue.svelte';
|
||||||
import { mdiDeleteOutline, mdiHistory } from '@mdi/js';
|
import { mdiDeleteOutline, mdiHistory } from '@mdi/js';
|
||||||
|
import UpdatePanel from '$lib/components/shared-components/update-panel.svelte';
|
||||||
|
|
||||||
export let data: PageData;
|
export let data: PageData;
|
||||||
|
|
||||||
@@ -113,3 +114,4 @@
|
|||||||
</svelte:fragment>
|
</svelte:fragment>
|
||||||
</ConfirmDialogue>
|
</ConfirmDialogue>
|
||||||
{/if}
|
{/if}
|
||||||
|
<UpdatePanel {assetStore} />
|
||||||
|
|||||||
@@ -121,7 +121,6 @@
|
|||||||
|
|
||||||
<DownloadPanel />
|
<DownloadPanel />
|
||||||
<UploadPanel />
|
<UploadPanel />
|
||||||
<UpdatePanel />
|
|
||||||
<NotificationList />
|
<NotificationList />
|
||||||
|
|
||||||
{#if data.user?.isAdmin}
|
{#if data.user?.isAdmin}
|
||||||
|
|||||||
Reference in New Issue
Block a user