mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-02 22:17:03 +03:00
Renamed SaveSettingsStep to more logical SaveSettingStatus
This commit is contained in:
parent
0864d306d6
commit
118558cdfd
8 changed files with 36 additions and 36 deletions
|
|
@ -29,11 +29,11 @@ UploadErrorCode = {
|
|||
/**
|
||||
* @enum {number}
|
||||
*/
|
||||
SaveSettingsStep = {
|
||||
Animate: -2,
|
||||
SaveSettingStatus = {
|
||||
Saving: -2,
|
||||
Idle: -1,
|
||||
TrueResult: 1,
|
||||
FalseResult: 0
|
||||
Success: 1,
|
||||
Failed: 0
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { SaveSettingsStep } from 'Common/Enums';
|
||||
import { SaveSettingStatus } from 'Common/Enums';
|
||||
import { elementById } from 'Common/Globals';
|
||||
|
||||
let __themeTimer = 0,
|
||||
|
|
@ -40,14 +40,14 @@ export const
|
|||
changeTheme = (value, themeTrigger = ()=>0) => {
|
||||
const themeStyle = elementById('app-theme-style'),
|
||||
clearTimer = () => {
|
||||
__themeTimer = setTimeout(() => themeTrigger(SaveSettingsStep.Idle), 1000);
|
||||
__themeTimer = setTimeout(() => themeTrigger(SaveSettingStatus.Idle), 1000);
|
||||
__themeJson = null;
|
||||
},
|
||||
url = themeStyle.dataset.href.replace(/(Admin|User)\/-\/[^/]+\//, '$1/-/' + value + '/') + 'Json/';
|
||||
|
||||
clearTimeout(__themeTimer);
|
||||
|
||||
themeTrigger(SaveSettingsStep.Animate);
|
||||
themeTrigger(SaveSettingStatus.Saving);
|
||||
|
||||
if (__themeJson) {
|
||||
__themeJson.abort();
|
||||
|
|
@ -61,7 +61,7 @@ export const
|
|||
.then(data => {
|
||||
if (2 === arrayLength(data)) {
|
||||
themeStyle.textContent = data[1];
|
||||
themeTrigger(SaveSettingsStep.TrueResult);
|
||||
themeTrigger(SaveSettingStatus.Success);
|
||||
}
|
||||
})
|
||||
.then(clearTimer, clearTimer);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue