fix formatjs setup, #62

This commit is contained in:
or-else
2021-01-26 13:58:59 -08:00
parent a319e2b0bc
commit 1172adefb4
8 changed files with 22 additions and 13 deletions
+4 -4
View File
@@ -240,7 +240,7 @@ class TinodeWeb extends React.Component {
console.log("Failed to register service worker:", err);
});
} catch (err) {
this.handleError(formatMessage({id: 'push_init_failed'}), 'err');
this.handleError(formatMessage(messages.push_init_failed), 'err');
console.log("Failed to initialize push notifications", err);
this.setState({desktopAlertsEnabled: false});
}
@@ -361,7 +361,7 @@ class TinodeWeb extends React.Component {
if (online) {
this.handleError();
} else {
this.handleError(this.props.intl.formatMessage({id: 'no_connection'}), 'warn');
this.handleError(this.props.intl.formatMessage(messages.no_connection), 'warn');
}
this.setState({liveConnection: online});
}
@@ -484,7 +484,7 @@ class TinodeWeb extends React.Component {
if (ctrl.code >= 300 && ctrl.text === 'validate credentials') {
this.setState({loadSpinnerVisible: false});
if (cred) {
this.handleError(this.props.intl.formatMessage({id: 'code_doesnot_match'}), 'warn');
this.handleError(this.props.intl.formatMessage(messages.code_doesnot_match), 'warn');
}
this.handleCredentialsRequest(ctrl.params);
} else {
@@ -1375,7 +1375,7 @@ class TinodeWeb extends React.Component {
handleResetPassword(scheme, newPassword, token) {
token = base64ReEncode(token);
if (!token) {
this.handleError(this.props.intl.formatMessage({id: 'invalid_security_token'}), 'err');
this.handleError(this.props.intl.formatMessage(messages.invalid_security_token), 'err');
} else {
this.tinode.connect()
.then(() => {