Web: Client: move init tfa to setupStore
This commit is contained in:
parent
b72d14dc98
commit
797c71551b
@ -563,7 +563,7 @@ const Shell = ({ items = [], page = "home", ...rest }) => {
|
||||
);
|
||||
};
|
||||
|
||||
const ShellWrapper = inject(({ auth, backup }) => {
|
||||
const ShellWrapper = inject(({ auth, backup, setup }) => {
|
||||
const { init, isLoaded, settingsStore, setProductVersion, language } = auth;
|
||||
const {
|
||||
personal,
|
||||
@ -578,9 +578,11 @@ const ShellWrapper = inject(({ auth, backup }) => {
|
||||
setTheme,
|
||||
} = settingsStore;
|
||||
const { setPreparationPortalDialogVisible } = backup;
|
||||
const { initSettings } = setup;
|
||||
return {
|
||||
loadBaseInfo: async () => {
|
||||
await init();
|
||||
await initSettings();
|
||||
|
||||
setModuleInfo(config.homepage, "home");
|
||||
setProductVersion(config.version);
|
||||
|
@ -2,12 +2,16 @@ import api from "@appserver/common/api";
|
||||
import { makeAutoObservable } from "mobx";
|
||||
const { Filter } = api;
|
||||
import SelectionStore from "./SelectionStore";
|
||||
import authStore from "@appserver/common/store/AuthStore";
|
||||
import { combineUrl } from "@appserver/common/utils";
|
||||
import { AppServerConfig } from "@appserver/common/constants";
|
||||
import config from "../../package.json";
|
||||
|
||||
class SettingsSetupStore {
|
||||
selectionStore = null;
|
||||
authStore = null;
|
||||
|
||||
isInit = false;
|
||||
|
||||
common = {
|
||||
whiteLabel: {
|
||||
@ -45,9 +49,20 @@ class SettingsSetupStore {
|
||||
|
||||
constructor() {
|
||||
this.selectionStore = new SelectionStore(this);
|
||||
this.authStore = authStore;
|
||||
makeAutoObservable(this);
|
||||
}
|
||||
|
||||
initSettings = async () => {
|
||||
if (this.isInit) return;
|
||||
this.isInit = true;
|
||||
|
||||
console.log("INIT STORE");
|
||||
if (authStore.isAuthenticated) {
|
||||
authStore.tfaStore.getTfaType();
|
||||
}
|
||||
};
|
||||
|
||||
setIsLoading = (isLoading) => {
|
||||
this.security.accessRight.isLoading = isLoading;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user