From 2933eb594d2ee204223bb06cffa98f4e9df05f11 Mon Sep 17 00:00:00 2001 From: Daniel Abrao Date: Sun, 14 Apr 2024 11:22:26 -0300 Subject: [PATCH] Remove unnecessary code --- .../socketio/socketQueueItemStatusChanged.ts | 30 ------------------- 1 file changed, 30 deletions(-) diff --git a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/socketio/socketQueueItemStatusChanged.ts b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/socketio/socketQueueItemStatusChanged.ts index 42d8dc3c88..0545a05985 100644 --- a/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/socketio/socketQueueItemStatusChanged.ts +++ b/invokeai/frontend/web/src/app/store/middleware/listenerMiddleware/listeners/socketio/socketQueueItemStatusChanged.ts @@ -5,30 +5,6 @@ import { socketQueueItemStatusChanged } from 'services/events/actions'; const log = logger('socketio'); -/** - * Updates the page's title to reflect the current length of the active queue. - * If there are items in the queue, the title will be prefixed with the count inside parentheses. - * If the queue is empty, the title will revert to its original state without any count. - * - * @param {number} activeQueueLength - The number of active items in the queue. - */ -const updatePageTitle = (activeQueueLength: number) => { - const baseString: string = document.title.replace(/\(\d+\) /, ''); - document.title = activeQueueLength > 0 ? `(${activeQueueLength}) ${baseString}` : baseString; -}; - -/** - * Updates the favicon of the page based on the presence of items in the queue. - * If there are items in the queue, it uses an alert favicon. Otherwise, it reverts to the default favicon. - * - * @param {number} activeQueueLength - The number of active items in the queue. - */ -const updatePageFavicon = (activeQueueLength: number) => { - const InvokeLogoSVG: string = 'assets/images/invoke-favicon.svg'; - const InvokeAlertLogoSVG: string = 'assets/images/invoke-alert-favicon.svg'; - const faviconEl: HTMLLinkElement = document.getElementById('invoke-favicon') as HTMLLinkElement; - faviconEl.href = activeQueueLength > 0 ? InvokeAlertLogoSVG : InvokeLogoSVG; -}; export const addSocketQueueItemStatusChangedEventListener = (startAppListening: AppStartListening) => { startAppListening({ @@ -37,9 +13,6 @@ export const addSocketQueueItemStatusChangedEventListener = (startAppListening: // we've got new status for the queue item, batch and queue const { queue_item, batch_status, queue_status } = action.payload.data; - // Keep track of the active queue length by summing up pending and in_progress count - const activeQueueLength: number = queue_status.pending + queue_status.in_progress || 0; - log.debug(action.payload, `Queue item ${queue_item.item_id} status updated: ${queue_item.status}`); // Update this specific queue item in the list of queue items (this is the queue item DTO, without the session) @@ -82,9 +55,6 @@ export const addSocketQueueItemStatusChangedEventListener = (startAppListening: dispatch( queueApi.util.invalidateTags(['CurrentSessionQueueItem', 'NextSessionQueueItem', 'InvocationCacheStatus']) ); - - updatePageTitle(activeQueueLength); - updatePageFavicon(activeQueueLength); }, }); };