Merge branch 'dev' of https://github.com/QLHazyCoder/codex-oauth-automation-extension into dev
This commit is contained in:
@@ -528,6 +528,7 @@ let currentAutoRun = {
|
||||
let settingsDirty = false;
|
||||
let settingsSaveInFlight = false;
|
||||
let settingsAutoSaveTimer = null;
|
||||
let settingsSaveRevision = 0;
|
||||
let cloudflareDomainEditMode = false;
|
||||
let cloudflareTempEmailDomainEditMode = false;
|
||||
let modalChoiceResolver = null;
|
||||
@@ -1864,6 +1865,9 @@ async function clearRegistrationEmail(options = {}) {
|
||||
|
||||
function markSettingsDirty(isDirty = true) {
|
||||
settingsDirty = isDirty;
|
||||
if (isDirty) {
|
||||
settingsSaveRevision += 1;
|
||||
}
|
||||
updateSaveButtonState();
|
||||
}
|
||||
|
||||
@@ -1889,6 +1893,7 @@ async function saveSettings(options = {}) {
|
||||
}
|
||||
|
||||
const payload = collectSettingsPayload();
|
||||
const saveRevision = settingsSaveRevision;
|
||||
settingsSaveInFlight = true;
|
||||
updateSaveButtonState();
|
||||
|
||||
@@ -1903,11 +1908,13 @@ async function saveSettings(options = {}) {
|
||||
throw new Error(response.error);
|
||||
}
|
||||
|
||||
if (response?.state) {
|
||||
if (response?.state && saveRevision === settingsSaveRevision) {
|
||||
applySettingsState(response.state);
|
||||
} else {
|
||||
syncLatestState(payload);
|
||||
markSettingsDirty(false);
|
||||
if (saveRevision === settingsSaveRevision) {
|
||||
markSettingsDirty(false);
|
||||
}
|
||||
updatePanelModeUI();
|
||||
updateMailProviderUI();
|
||||
updateButtonStates();
|
||||
|
||||
Reference in New Issue
Block a user