await init and wait for APP_READY

This commit is contained in:
LenAnderson 2024-01-18 20:43:31 +00:00
parent 8874ffffc5
commit 65d9c944d8
1 changed files with 4 additions and 1 deletions

View File

@ -198,6 +198,9 @@ const init = async () => {
slash.init();
autoExec = new AutoExecuteHandler(settings);
eventSource.on(event_types.APP_READY, ()=>finalizeInit());
};
const finalizeInit = async () => {
log('executing startup');
await autoExec.handleStartup();
log('/executing startup');
@ -211,7 +214,7 @@ const init = async () => {
isReady = true;
log('READY');
};
init();
await init();
const onChatChanged = async (chatIdx) => {
log('CHAT_CHANGED', chatIdx);