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 { power_user } from './power-user.js';
|
||||||
import { debounce, waitUntilCondition, escapeHtml } from './utils.js';
|
import { debounce, waitUntilCondition, escapeHtml } from './utils.js';
|
||||||
import { debounce_timeout } from './constants.js';
|
import { debounce_timeout } from './constants.js';
|
||||||
import { renderTemplateAsync } from './templates.js'
|
import { renderTemplateAsync } from './templates.js';
|
||||||
|
|
||||||
function debouncePromise(func, delay) {
|
function debouncePromise(func, delay) {
|
||||||
let timeoutId;
|
let timeoutId;
|
||||||
@ -251,7 +251,7 @@ class PromptManager {
|
|||||||
this.error = null;
|
this.error = null;
|
||||||
|
|
||||||
/** Dry-run for generate, must return a promise */
|
/** Dry-run for generate, must return a promise */
|
||||||
this.tryGenerate = () => { };
|
this.tryGenerate = async () => { };
|
||||||
|
|
||||||
/** Called to persist the configuration, must return a promise */
|
/** Called to persist the configuration, must return a promise */
|
||||||
this.saveServiceSettings = () => { };
|
this.saveServiceSettings = () => { };
|
||||||
@ -696,21 +696,23 @@ class PromptManager {
|
|||||||
if ('character' === this.configuration.promptOrder.strategy && null === this.activeCharacter) return;
|
if ('character' === this.configuration.promptOrder.strategy && null === this.activeCharacter) return;
|
||||||
this.error = null;
|
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) {
|
if (true === afterTryGenerate) {
|
||||||
// Executed during dry-run for determining context composition
|
// Executed during dry-run for determining context composition
|
||||||
this.profileStart('filling context');
|
this.profileStart('filling context');
|
||||||
this.tryGenerate().finally(() => {
|
this.tryGenerate().finally(async () => {
|
||||||
this.profileEnd('filling context');
|
this.profileEnd('filling context');
|
||||||
this.profileStart('render');
|
this.profileStart('render');
|
||||||
this.renderPromptManager().then(() => this.renderPromptManagerListItems());
|
await this.renderPromptManager();
|
||||||
|
await this.renderPromptManagerListItems();
|
||||||
this.makeDraggable();
|
this.makeDraggable();
|
||||||
this.profileEnd('render');
|
this.profileEnd('render');
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// Executed during live communication
|
// Executed during live communication
|
||||||
this.profileStart('render');
|
this.profileStart('render');
|
||||||
this.renderPromptManager().then(() => this.renderPromptManagerListItems());
|
await this.renderPromptManager();
|
||||||
|
await this.renderPromptManagerListItems();
|
||||||
this.makeDraggable();
|
this.makeDraggable();
|
||||||
this.profileEnd('render');
|
this.profileEnd('render');
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user