Render prompt manager before a character is selected

When prompt order strategy is global
This commit is contained in:
maver 2023-08-20 16:28:42 +02:00
parent 59179f6c70
commit 07c24f363f
2 changed files with 4 additions and 3 deletions

View File

@ -273,6 +273,8 @@ PromptManagerModule.prototype.init = function (moduleConfiguration, serviceSetti
this.serviceSettings = serviceSettings;
this.containerElement = document.getElementById(this.configuration.containerIdentifier);
if ('global' === this.configuration.promptOrder.strategy) this.activeCharacter = {id: this.configuration.promptOrder.dummyId};
this.sanitizeServiceSettings();
// Enable and disable prompts
@ -592,7 +594,7 @@ PromptManagerModule.prototype.init = function (moduleConfiguration, serviceSetti
PromptManagerModule.prototype.render = function (afterTryGenerate = true) {
if (main_api !== 'openai') return;
if (null === this.activeCharacter) return;
if ('character' === this.configuration.promptOrder.strategy && null === this.activeCharacter) return;
this.error = null;
waitUntilCondition(() => !is_send_press && !is_group_generating, 1024 * 1024, 100).then(() => {

View File

@ -19,7 +19,6 @@ import {
system_message_types,
replaceBiasMarkup,
is_send_press,
saveSettings,
Generate,
main_api,
eventSource,
@ -389,7 +388,7 @@ function setupChatCompletionPromptManager(openAiSettings) {
promptManager.tokenHandler = tokenHandler;
promptManager.init(configuration, openAiSettings);
promptManager.render();
promptManager.render(false);
return promptManager;
}