| 2639 | 2639 | async function continueChatCallback(args, prompt) { |
| 2640 | 2640 | const shouldAwait = isTrueBoolean(args?.await); |
| 2641 | 2641 | |
| 2642 | 2642 | const outerPromise = new Promise(async (resolve, reject) => { |
| 2643 | | - setTimeout(async () => { |
| 2643 | + try { |
| 2644 | | - try { |
| 2644 | + await waitUntilCondition(() => !is_send_press && !is_group_generating, 10000, 100); |
| 2645 | | - await waitUntilCondition(() => !is_send_press && !is_group_generating, 10000, 100); |
| 2645 | + } catch { |
| 2646 | | - } catch { |
| 2646 | + console.warn('Timeout waiting for generation unlock'); |
| 2647 | | - console.warn('Timeout waiting for generation unlock'); |
| 2647 | + toastr.warning('Cannot run /continue command while the reply is being generated.'); |
| 2648 | | - toastr.warning('Cannot run /continue command while the reply is being generated.'); |
| 2648 | + return reject(); |
| 2649 | 2649 | } |
| 2650 | 2650 | |
| 2651 | + try { |
| 2651 | 2652 | // Prevent infinite recursion |
| 2652 | 2653 | $('#send_textarea').val('')[0].dispatchEvent(new Event('input', { bubbles: true })); |
| 2653 | 2654 | |