Move extensions init to function

ff989b3352b085f04063ed8e5a267e3bc2599e0e

Wolfsblvt <wolfsblvt@gmail.com>

2 files changed, +4 -3Ignore whitespace
public/script.js+2 -1
@@ -158,7 +158,7 @@ import {
158} from './scripts/utils.js';158} from './scripts/utils.js';
159import { debounce_timeout } from './scripts/constants.js';159import { debounce_timeout } from './scripts/constants.js';
160160
161import { ModuleWorkerWrapper, doDailyExtensionUpdatesCheck, extension_settings, getContext, loadExtensionSettings, renderExtensionTemplate, renderExtensionTemplateAsync, runGenerationInterceptors, saveMetadataDebounced, writeExtensionField } from './scripts/extensions.js';161import { ModuleWorkerWrapper, doDailyExtensionUpdatesCheck, extension_settings, getContext, initExtensions, loadExtensionSettings, renderExtensionTemplate, renderExtensionTemplateAsync, runGenerationInterceptors, saveMetadataDebounced, writeExtensionField } from './scripts/extensions.js';
162import { COMMENT_NAME_DEFAULT, executeSlashCommands, executeSlashCommandsOnChatInput, executeSlashCommandsWithOptions, getSlashCommandsHelp, initDefaultSlashCommands, isExecutingCommandsFromChatInput, pauseScriptExecution, processChatSlashCommands, registerSlashCommand, stopScriptExecution } from './scripts/slash-commands.js';162import { COMMENT_NAME_DEFAULT, executeSlashCommands, executeSlashCommandsOnChatInput, executeSlashCommandsWithOptions, getSlashCommandsHelp, initDefaultSlashCommands, isExecutingCommandsFromChatInput, pauseScriptExecution, processChatSlashCommands, registerSlashCommand, stopScriptExecution } from './scripts/slash-commands.js';
163import {163import {
164 tag_map,164 tag_map,
@@ -956,6 +956,7 @@ async function firstLoadInit() {
956 initCfg();956 initCfg();
957 initLogprobs();957 initLogprobs();
958 initInputMarkdown();958 initInputMarkdown();
959 initExtensions();
959 doDailyExtensionUpdatesCheck();960 doDailyExtensionUpdatesCheck();
960 await hideLoader();961 await hideLoader();
961 await fixViewport();962 await fixViewport();
public/scripts/extensions.js+2 -2
@@ -1041,7 +1041,7 @@ export async function openThirdPartyExtensionMenu(suggestUrl = '') {
1041 await installExtension(url);1041 await installExtension(url);
1042}1042}
10431043
1044jQuery(async function () {1044export async function initExtensions() {
1045 await addExtensionsButtonAndMenu();1045 await addExtensionsButtonAndMenu();
1046 $('#extensionsMenuButton').css('display', 'flex');1046 $('#extensionsMenuButton').css('display', 'flex');
10471047
@@ -1060,4 +1060,4 @@ jQuery(async function () {
1060 * @listens #third_party_extension_button#click - The click event of the '#third_party_extension_button' element.1060 * @listens #third_party_extension_button#click - The click event of the '#third_party_extension_button' element.
1061 */1061 */
1062 $('#third_party_extension_button').on('click', () => openThirdPartyExtensionMenu());1062 $('#third_party_extension_button').on('click', () => openThirdPartyExtensionMenu());
1063});1063}