1
0
Fork 0
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:
Andrew Simachev 2024-06-17 11:02:01 +02:00
parent b2e0c57298
commit 50790b7ae1
No known key found for this signature in database
GPG key ID: 49A163D0D14E6FD8
13 changed files with 24 additions and 12 deletions

View file

@ -634,4 +634,4 @@
"pre-commit": "npm run precommit && git add licenses.json"
}
}
}
}

View file

@ -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 });

View file

@ -105,7 +105,6 @@ const HeaderMainObject = observer(class HeaderMainObject extends React.Component
};
init () {
keyboard.setWindowTitle();
this.updateTemplatesCnt();
};

View file

@ -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}
/>

View file

@ -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;

View file

@ -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 });
};

View file

@ -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>

View file

@ -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) }));

View file

@ -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}
/>

View file

@ -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) {

View file

@ -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;

View file

@ -119,6 +119,10 @@ class Storage {
});
};
getPin () {
return this.get('pin');
};
setLastOpened (windowId: string, param: any) {
const obj = this.get('lastOpenedObject') || {};

View file

@ -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');