mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2024-12-12 09:26:33 +01:00
Prevent duplicate toasts
This commit is contained in:
parent
620847c4d6
commit
8dd7a97eb3
@ -4413,7 +4413,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
|
||||
generatedPromptCache = '';
|
||||
|
||||
if (data?.response) {
|
||||
toastr.error(data.response, 'API Error');
|
||||
toastr.error(data.response, 'API Error', { preventDuplicates: true });
|
||||
}
|
||||
throw new Error(data?.response);
|
||||
}
|
||||
|
@ -2262,7 +2262,7 @@ async function generateRawCallback(args, value) {
|
||||
return result;
|
||||
} catch (err) {
|
||||
console.error('Error on /genraw generation', err);
|
||||
toastr.error(err.message, 'Error on Generate');
|
||||
toastr.error(err.message, 'API Error', { preventDuplicates: true });
|
||||
} finally {
|
||||
if (lock) {
|
||||
activateSendButtons();
|
||||
@ -2297,7 +2297,7 @@ async function generateCallback(args, value) {
|
||||
return result;
|
||||
} catch (err) {
|
||||
console.error('Error on /gen generation', err);
|
||||
toastr.error(err.message, 'Error on Generate');
|
||||
toastr.error(err.message, 'API Error', { preventDuplicates: true });
|
||||
} finally {
|
||||
if (lock) {
|
||||
activateSendButtons();
|
||||
|
Loading…
Reference in New Issue
Block a user