mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Implement updatePageTitle
and updatePageFavicon
methods
This commit is contained in:
parent
4cd09850b8
commit
0a9bf25bff
@ -5,6 +5,18 @@ import { socketQueueItemStatusChanged } from 'services/events/actions';
|
||||
|
||||
const log = logger('socketio');
|
||||
|
||||
const updatePageTitle = (itemStatus: string)=> {
|
||||
let baseString: string = document.title.replace('(1) ', '');
|
||||
document.title = itemStatus === 'in_progress' ? `(1) ${baseString}` : baseString;
|
||||
}
|
||||
|
||||
const updatePageFavicon = (itemStatus: string)=> {
|
||||
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 = itemStatus === 'in_progress' ? InvokeAlertLogoSVG : InvokeLogoSVG;
|
||||
}
|
||||
|
||||
export const addSocketQueueItemStatusChangedEventListener = (startAppListening: AppStartListening) => {
|
||||
startAppListening({
|
||||
actionCreator: socketQueueItemStatusChanged,
|
||||
|
Loading…
Reference in New Issue
Block a user