mirror of
https://github.com/anyproto/anytype-ts.git
synced 2025-06-08 05:57:02 +09:00
JS-4684: fix
This commit is contained in:
parent
b2e0c57298
commit
50790b7ae1
13 changed files with 24 additions and 12 deletions
|
@ -634,4 +634,4 @@
|
|||
"pre-commit": "npm run precommit && git add licenses.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -235,7 +235,7 @@ class Phrase extends React.Component<Props, State> {
|
|||
onToggle () {
|
||||
const { checkPin, onToggle } = this.props;
|
||||
const { isHidden } = this.state;
|
||||
const pin = Storage.get('pin');
|
||||
const pin = Storage.getPin();
|
||||
const onSuccess = () => {
|
||||
this.setState({ isHidden: !isHidden });
|
||||
|
||||
|
|
|
@ -105,7 +105,6 @@ const HeaderMainObject = observer(class HeaderMainObject extends React.Component
|
|||
};
|
||||
|
||||
init () {
|
||||
keyboard.setWindowTitle();
|
||||
this.updateTemplatesCnt();
|
||||
};
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ const PageAuthPinCheck = observer(class PageAuthPinCheck extends React.Component
|
|||
<Title text={translate('authPinCheckTitle')} />
|
||||
<Pin
|
||||
ref={ref => this.ref = ref}
|
||||
expectedPin={Storage.get('pin')}
|
||||
expectedPin={Storage.getPin()}
|
||||
onSuccess={this.onSuccess}
|
||||
onError={this.onError}
|
||||
/>
|
||||
|
|
|
@ -188,7 +188,7 @@ const Page = observer(class Page extends React.Component<I.PageComponent> {
|
|||
const isAuth = this.isAuth();
|
||||
const isMain = this.isMain();
|
||||
const isPinCheck = this.isAuthPinCheck();
|
||||
const pin = Storage.get('pin');
|
||||
const pin = Storage.getPin();
|
||||
const win = $(window);
|
||||
const path = [ page, action ].join('/');
|
||||
const Component = Components[path];
|
||||
|
@ -196,6 +196,7 @@ const Page = observer(class Page extends React.Component<I.PageComponent> {
|
|||
|
||||
Preview.tooltipHide(true);
|
||||
Preview.previewHide(true);
|
||||
keyboard.setWindowTitle();
|
||||
|
||||
if (!Component) {
|
||||
return;
|
||||
|
|
|
@ -93,7 +93,7 @@ const PopupSettingsPagePhrase = observer(class PopupSettingsPagePhrase extends R
|
|||
|
||||
onCode () {
|
||||
const { showCode } = this.state;
|
||||
const pin = Storage.get('pin');
|
||||
const pin = Storage.getPin();
|
||||
const onSuccess = () => {
|
||||
this.setState({ showCode: !showCode });
|
||||
};
|
||||
|
|
|
@ -18,7 +18,7 @@ const PopupSettingsPagePinConfirm = observer(class PopupSettingsPagePinConfirm e
|
|||
render () {
|
||||
const { onPage, prevPage } = this.props;
|
||||
const { error } = this.state;
|
||||
const pin = Storage.get('pin');
|
||||
const pin = Storage.getPin();
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
|
|
|
@ -7,7 +7,7 @@ import { observer } from 'mobx-react';
|
|||
const PopupSettingsPagePinIndex = observer(class PopupSettingsPagePinIndex extends React.Component<I.PopupSettings> {
|
||||
|
||||
render () {
|
||||
const pin = Storage.get('pin');
|
||||
const pin = Storage.getPin();
|
||||
const pinTime = commonStore.pinTime / 1000;
|
||||
const times = [ 60, 300, 600, 3600 ].map(time => ({ id: time, name: UtilDate.duration(time) }));
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ const PopupPin = observer(class PopupConfirm extends React.Component<I.Popup, St
|
|||
<Title text={translate('authPinCheckTitle')} />
|
||||
<Pin
|
||||
ref={ref => this.ref = ref}
|
||||
expectedPin={Storage.get('pin')}
|
||||
expectedPin={Storage.getPin()}
|
||||
onSuccess={this.onSuccess}
|
||||
onError={this.onError}
|
||||
/>
|
||||
|
|
|
@ -7,7 +7,7 @@ import Events from 'dist/lib/pb/protos/events_pb';
|
|||
import Service from 'dist/lib/pb/protos/service/service_grpc_web_pb';
|
||||
import { authStore, commonStore, blockStore, detailStore, dbStore, notificationStore } from 'Store';
|
||||
import {
|
||||
UtilCommon, UtilObject, I, M, translate, analytics, Renderer, Action, Dataview, Preview, Mapper, Decode, UtilRouter, Storage, UtilSpace, UtilData
|
||||
UtilCommon, UtilObject, I, M, translate, analytics, Renderer, Action, Dataview, Preview, Mapper, Decode, UtilRouter, Storage, UtilSpace, UtilData, keyboard
|
||||
} from 'Lib';
|
||||
import * as Response from './response';
|
||||
import { ClientReadableStream } from 'grpc-web';
|
||||
|
@ -1106,6 +1106,8 @@ class Dispatcher {
|
|||
blockStore.updateNumbers(contextId);
|
||||
blockStore.updateMarkup(contextId);
|
||||
blockStore.checkTypeSelect(contextId);
|
||||
|
||||
keyboard.setWindowTitle();
|
||||
};
|
||||
|
||||
public request (type: string, data: any, callBack?: (message: any) => void) {
|
||||
|
|
|
@ -898,6 +898,12 @@ class Keyboard {
|
|||
};
|
||||
|
||||
setWindowTitle () {
|
||||
const pin = Storage.getPin();
|
||||
if (pin && !this.isPinChecked) {
|
||||
document.title = Constant.appName;
|
||||
return;
|
||||
};
|
||||
|
||||
const match = this.getMatch();
|
||||
const action = match?.params?.action;
|
||||
const titles = {
|
||||
|
@ -1007,7 +1013,7 @@ class Keyboard {
|
|||
initPinCheck () {
|
||||
const { account } = authStore;
|
||||
const check = () => {
|
||||
const pin = Storage.get('pin');
|
||||
const pin = Storage.getPin();
|
||||
if (!pin) {
|
||||
this.setPinChecked(true);
|
||||
return false;
|
||||
|
|
|
@ -119,6 +119,10 @@ class Storage {
|
|||
});
|
||||
};
|
||||
|
||||
getPin () {
|
||||
return this.get('pin');
|
||||
};
|
||||
|
||||
setLastOpened (windowId: string, param: any) {
|
||||
const obj = this.get('lastOpenedObject') || {};
|
||||
|
||||
|
|
|
@ -191,7 +191,7 @@ class UtilData {
|
|||
param = param || {};
|
||||
param.routeParam = param.routeParam || {};
|
||||
|
||||
const pin = Storage.get('pin');
|
||||
const pin = Storage.getPin();
|
||||
const { root, widgets } = blockStore;
|
||||
const { redirect, space } = commonStore;
|
||||
const color = Storage.get('color');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue