mirror of
https://github.com/bakhirev/assayo.git
synced 2025-02-22 13:02:18 +00:00
update
This commit is contained in:
parent
734ed93a32
commit
10e39d967e
File diff suppressed because one or more lines are too long
|
@ -1,5 +1,7 @@
|
|||
import { makeObservable, observable, action } from 'mobx';
|
||||
|
||||
import { t } from 'ts/helpers/Localization';
|
||||
|
||||
export interface IConfirmStore {
|
||||
title: string;
|
||||
yes: string;
|
||||
|
@ -36,9 +38,9 @@ class ConfirmStore implements IConfirmStore {
|
|||
}
|
||||
|
||||
open(options?: any) {
|
||||
this.title = options?.title || options || 'Вы уверены что хотите удалить?';
|
||||
this.yes = options?.yes || 'Да, уверен';
|
||||
this.no = options?.no || 'Отмена';
|
||||
this.title = options?.title || options || t('common.confirm.title');
|
||||
this.yes = options?.yes || t('common.confirm.yes');
|
||||
this.no = options?.no || t('common.confirm.no');
|
||||
this.isOpen = true;
|
||||
return new Promise((response: any, reject: any) => {
|
||||
this.successCallback = response;
|
||||
|
|
|
@ -4,6 +4,7 @@ import { useTranslation } from 'react-i18next';
|
|||
|
||||
import localization from 'ts/helpers/Localization';
|
||||
import dataGripStore from 'ts/store/DataGrip';
|
||||
import viewNameStore, { ViewNameEnum } from 'ts/store/ViewName';
|
||||
import confirm from 'ts/components/ModalWindow/store/Confirm';
|
||||
|
||||
import Button from './Button';
|
||||
|
@ -47,8 +48,9 @@ function getMenu(navigate: Function): any[] {
|
|||
confirm.open({
|
||||
title: 'Вы уверены что хотите выйти?',
|
||||
}).then(() => {
|
||||
dataGripStore.asyncSetCommits([]);
|
||||
dataGripStore.exit();
|
||||
navigate('/');
|
||||
viewNameStore.toggle(ViewNameEnum.WELCOME);
|
||||
});
|
||||
},
|
||||
},
|
||||
|
|
|
@ -41,6 +41,7 @@ class DataGripStore {
|
|||
processingDataAnalysis: action,
|
||||
depersonalized: action,
|
||||
updateStatistic: action,
|
||||
exit: action,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -147,6 +148,13 @@ class DataGripStore {
|
|||
this.fileGrip = fileGrip;
|
||||
this.hash = Math.random();
|
||||
}
|
||||
|
||||
exit() {
|
||||
dataGrip.clear();
|
||||
fileGrip.clear();
|
||||
this.commits = [];
|
||||
this.#updateRender();
|
||||
}
|
||||
}
|
||||
|
||||
const dataGripStore = new DataGripStore();
|
||||
|
|
|
@ -26,4 +26,8 @@ export default `
|
|||
§ common.notifications.save: Изменения сохранены
|
||||
§ common.notifications.setting: Настройки сохранены
|
||||
§ common.fileLoader.notification: Ошибка загрузки файла $1
|
||||
§ common.confirm.title: Вы уверены что хотите удалить?
|
||||
§ common.confirm.yes: Да, уверен
|
||||
§ common.confirm.no: Отмена
|
||||
§ common.confirm.abc: abc
|
||||
`;
|
||||
|
|
Loading…
Reference in a new issue