refactor: move user-related data to appStore

This commit is contained in:
VardanHakobyan
2021-06-16 17:00:13 +04:00
parent 018251838c
commit c897199d33
5 changed files with 10 additions and 31 deletions

View File

@@ -1,19 +1,16 @@
import { AppState } from '@/ui_models/app_state';
import { useState } from 'preact/hooks';
import { WebApplication } from '@/ui_models/application';
import { User } from '@standardnotes/snjs/dist/@types/services/api/responses';
import { observer } from 'mobx-react-lite';
type Props = {
application: WebApplication;
appState: AppState;
user: User | undefined;
}
const Footer = observer(({
application,
appState,
user
}: Props) => {
const {
showLogin,
@@ -23,6 +20,8 @@ const Footer = observer(({
setSigningOut
} = appState.accountMenu;
const user = application.getUser();
const { showBetaWarning, disableBetaWarning: disableAppStateBetaWarning } = appState;
const [appVersion] = useState(() => `v${((window as any).electronAppVersion || application.bridge.appVersion)}`);