Move extensions init to function

This commit is contained in:
Wolfsblvt
2024-09-25 21:58:46 +02:00
parent fbc590b641
commit ff989b3352
2 changed files with 4 additions and 3 deletions

View File

@@ -158,7 +158,7 @@ import {
} from './scripts/utils.js'; } from './scripts/utils.js';
import { debounce_timeout } from './scripts/constants.js'; import { debounce_timeout } from './scripts/constants.js';
import { ModuleWorkerWrapper, doDailyExtensionUpdatesCheck, extension_settings, getContext, loadExtensionSettings, renderExtensionTemplate, renderExtensionTemplateAsync, runGenerationInterceptors, saveMetadataDebounced, writeExtensionField } from './scripts/extensions.js'; import { ModuleWorkerWrapper, doDailyExtensionUpdatesCheck, extension_settings, getContext, initExtensions, loadExtensionSettings, renderExtensionTemplate, renderExtensionTemplateAsync, runGenerationInterceptors, saveMetadataDebounced, writeExtensionField } from './scripts/extensions.js';
import { COMMENT_NAME_DEFAULT, executeSlashCommands, executeSlashCommandsOnChatInput, executeSlashCommandsWithOptions, getSlashCommandsHelp, initDefaultSlashCommands, isExecutingCommandsFromChatInput, pauseScriptExecution, processChatSlashCommands, registerSlashCommand, stopScriptExecution } from './scripts/slash-commands.js'; import { COMMENT_NAME_DEFAULT, executeSlashCommands, executeSlashCommandsOnChatInput, executeSlashCommandsWithOptions, getSlashCommandsHelp, initDefaultSlashCommands, isExecutingCommandsFromChatInput, pauseScriptExecution, processChatSlashCommands, registerSlashCommand, stopScriptExecution } from './scripts/slash-commands.js';
import { import {
tag_map, tag_map,
@@ -956,6 +956,7 @@ async function firstLoadInit() {
initCfg(); initCfg();
initLogprobs(); initLogprobs();
initInputMarkdown(); initInputMarkdown();
initExtensions();
doDailyExtensionUpdatesCheck(); doDailyExtensionUpdatesCheck();
await hideLoader(); await hideLoader();
await fixViewport(); await fixViewport();

View File

@@ -1041,7 +1041,7 @@ export async function openThirdPartyExtensionMenu(suggestUrl = '') {
await installExtension(url); await installExtension(url);
} }
jQuery(async function () { export async function initExtensions() {
await addExtensionsButtonAndMenu(); await addExtensionsButtonAndMenu();
$('#extensionsMenuButton').css('display', 'flex'); $('#extensionsMenuButton').css('display', 'flex');
@@ -1060,4 +1060,4 @@ jQuery(async function () {
* @listens #third_party_extension_button#click - The click event of the '#third_party_extension_button' element. * @listens #third_party_extension_button#click - The click event of the '#third_party_extension_button' element.
*/ */
$('#third_party_extension_button').on('click', () => openThirdPartyExtensionMenu()); $('#third_party_extension_button').on('click', () => openThirdPartyExtensionMenu());
}); }