2018-08-15 21:13:20 +02:00
|
|
|
import {isAutoApplyEnable, isReloadNotificationEnable} from './settings';
|
2018-08-12 12:48:23 +02:00
|
|
|
import {infoMessage} from './messages';
|
|
|
|
import {fixIcons} from '../commands';
|
|
|
|
|
2018-08-20 22:19:10 +02:00
|
|
|
let fixIconsRunning: boolean = false;
|
|
|
|
|
2018-08-12 12:48:23 +02:00
|
|
|
export default async (doubleCheck: boolean) => {
|
2018-08-20 22:19:10 +02:00
|
|
|
if (!doubleCheck || fixIconsRunning) {
|
2018-08-12 12:48:23 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (isAutoApplyEnable()) {
|
2018-08-20 22:19:10 +02:00
|
|
|
fixIconsRunning = true;
|
|
|
|
return fixIcons().then(() => fixIconsRunning = false);
|
2018-08-12 12:48:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!isReloadNotificationEnable()) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
const result = await infoMessage();
|
|
|
|
|
|
|
|
if (result.reload) {
|
2018-08-20 22:19:10 +02:00
|
|
|
fixIconsRunning = true;
|
|
|
|
return fixIcons().then(() => fixIconsRunning = false);
|
2018-08-12 12:48:23 +02:00
|
|
|
}
|
|
|
|
};
|