mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-01-20 21:41:32 +01:00
Fix translation key removal
This commit is contained in:
parent
a13d3f643c
commit
01b83f893b
@ -598,9 +598,20 @@ jQuery(async () => {
|
|||||||
$(document).on('click', '.mes_translate', onMessageTranslateClick);
|
$(document).on('click', '.mes_translate', onMessageTranslateClick);
|
||||||
$('#translate_key_button').on('click', async () => {
|
$('#translate_key_button').on('click', async () => {
|
||||||
const optionText = $('#translation_provider option:selected').text();
|
const optionText = $('#translation_provider option:selected').text();
|
||||||
const key = await callGenericPopup(`<h3>${optionText} API Key</h3>`, POPUP_TYPE.INPUT);
|
const key = await callGenericPopup(`<h3>${optionText} API Key</h3>`, POPUP_TYPE.INPUT, '', {
|
||||||
|
customButtons: [{
|
||||||
|
text: 'Remove Key',
|
||||||
|
appendAtEnd: true,
|
||||||
|
result: POPUP_RESULT.NEGATIVE,
|
||||||
|
action: async () => {
|
||||||
|
await writeSecret(extension_settings.translate.provider, '');
|
||||||
|
toastr.success('API Key removed');
|
||||||
|
$('#translate_key_button').toggleClass('success', !!secret_state[extension_settings.translate.provider]);
|
||||||
|
},
|
||||||
|
}],
|
||||||
|
});
|
||||||
|
|
||||||
if (key == false) {
|
if (!key) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -634,7 +645,7 @@ jQuery(async () => {
|
|||||||
}],
|
}],
|
||||||
});
|
});
|
||||||
|
|
||||||
if (url == false || url == '') {
|
if (!url) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user