mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Fix make draggable
This commit is contained in:
@ -6,7 +6,7 @@ import { Message, TokenHandler } from './openai.js';
|
||||
import { power_user } from './power-user.js';
|
||||
import { debounce, waitUntilCondition, escapeHtml } from './utils.js';
|
||||
import { debounce_timeout } from './constants.js';
|
||||
import { renderTemplateAsync } from './templates.js'
|
||||
import { renderTemplateAsync } from './templates.js';
|
||||
|
||||
function debouncePromise(func, delay) {
|
||||
let timeoutId;
|
||||
@ -251,7 +251,7 @@ class PromptManager {
|
||||
this.error = null;
|
||||
|
||||
/** Dry-run for generate, must return a promise */
|
||||
this.tryGenerate = () => { };
|
||||
this.tryGenerate = async () => { };
|
||||
|
||||
/** Called to persist the configuration, must return a promise */
|
||||
this.saveServiceSettings = () => { };
|
||||
@ -696,21 +696,23 @@ class PromptManager {
|
||||
if ('character' === this.configuration.promptOrder.strategy && null === this.activeCharacter) return;
|
||||
this.error = null;
|
||||
|
||||
waitUntilCondition(() => !is_send_press && !is_group_generating, 1024 * 1024, 100).then(() => {
|
||||
waitUntilCondition(() => !is_send_press && !is_group_generating, 1024 * 1024, 100).then(async () => {
|
||||
if (true === afterTryGenerate) {
|
||||
// Executed during dry-run for determining context composition
|
||||
this.profileStart('filling context');
|
||||
this.tryGenerate().finally(() => {
|
||||
this.tryGenerate().finally(async () => {
|
||||
this.profileEnd('filling context');
|
||||
this.profileStart('render');
|
||||
this.renderPromptManager().then(() => this.renderPromptManagerListItems());
|
||||
await this.renderPromptManager();
|
||||
await this.renderPromptManagerListItems();
|
||||
this.makeDraggable();
|
||||
this.profileEnd('render');
|
||||
});
|
||||
} else {
|
||||
// Executed during live communication
|
||||
this.profileStart('render');
|
||||
this.renderPromptManager().then(() => this.renderPromptManagerListItems());
|
||||
await this.renderPromptManager();
|
||||
await this.renderPromptManagerListItems();
|
||||
this.makeDraggable();
|
||||
this.profileEnd('render');
|
||||
}
|
||||
|
Reference in New Issue
Block a user