update button on USO page now confirms only on the first click
This commit is contained in:
parent
f1836f399f
commit
e8d0c7d039
|
@ -223,10 +223,12 @@ function onUpdate() {
|
||||||
|
|
||||||
function saveStyleCode(message, name, addProps) {
|
function saveStyleCode(message, name, addProps) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
if (!confirm(chrome.i18n.getMessage(message, [name]))) {
|
const needsConfirmation = message === 'styleInstall' || !saveStyleCode.confirmed;
|
||||||
|
if (needsConfirmation && !confirm(chrome.i18n.getMessage(message, [name]))) {
|
||||||
reject();
|
reject();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
saveStyleCode.confirmed = true;
|
||||||
enableUpdateButton(false);
|
enableUpdateButton(false);
|
||||||
getStyleJson().then(json => {
|
getStyleJson().then(json => {
|
||||||
if (!json) {
|
if (!json) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user