mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
Update metadata visualisation through the websocket
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
<script lang="ts">
|
||||
import { websocketStore } from '$lib/stores/websocket';
|
||||
import { AssetStore } from '$lib/stores/assets.store';
|
||||
import { notificationController, NotificationType } from './notification/notification';
|
||||
|
||||
let assetStore = new AssetStore(/* vos options ici */);
|
||||
let assetUpdateCount = 0;
|
||||
let lastAssetName;
|
||||
let timeoutId;
|
||||
@@ -10,12 +12,15 @@
|
||||
if (value && value.originalFileName) {
|
||||
lastAssetName = value.originalFileName;
|
||||
assetUpdateCount++;
|
||||
|
||||
assetStore.updateAsset(value);
|
||||
|
||||
clearTimeout(timeoutId);
|
||||
timeoutId = setTimeout(() => {
|
||||
if (assetUpdateCount === 1) {
|
||||
|
||||
notificationController.show({
|
||||
message: `Asset updated: ${lastAssetName}.\nPlease reload to apply changes`,
|
||||
message: `Asset updated: ${lastAssetName}.`,
|
||||
type: NotificationType.Info,
|
||||
});
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user