race condition when clearing DB
This commit is contained in:
@@ -124,7 +124,7 @@ class AccSecurityView extends React.Component {
|
|||||||
<div>
|
<div>
|
||||||
<label className="small">
|
<label className="small">
|
||||||
<FormattedMessage id="label_default_access_mode" defaultMessage="Default access mode:"
|
<FormattedMessage id="label_default_access_mode" defaultMessage="Default access mode:"
|
||||||
description="Label for default access mode" />
|
description="Label for default access mode" />
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div className="quoted">
|
<div className="quoted">
|
||||||
|
|||||||
@@ -1343,19 +1343,25 @@ class TinodeWeb extends React.Component {
|
|||||||
|
|
||||||
clearInterval(this.reconnectCountdown);
|
clearInterval(this.reconnectCountdown);
|
||||||
|
|
||||||
|
let cleared;
|
||||||
if (this.tinode) {
|
if (this.tinode) {
|
||||||
this.tinode.clearStorage();
|
cleared = this.tinode.clearStorage();
|
||||||
this.tinode.onDisconnect = undefined;
|
this.tinode.onDisconnect = undefined;
|
||||||
this.tinode.disconnect();
|
this.tinode.disconnect();
|
||||||
|
} else {
|
||||||
|
cleared = Promose.resolve();
|
||||||
}
|
}
|
||||||
this.setState(this.getBlankState());
|
this.setState(this.getBlankState());
|
||||||
|
|
||||||
this.tinode = TinodeWeb.tnSetup(this.state.serverAddress,
|
cleared.then(() => {
|
||||||
this.state.transport, this.props.intl.locale, LocalStorageUtil.getObject('keep-logged-in'));
|
this.tinode = TinodeWeb.tnSetup(this.state.serverAddress,
|
||||||
this.tinode.onConnect = this.handleConnected;
|
this.state.transport, this.props.intl.locale, LocalStorageUtil.getObject('keep-logged-in'), () => {
|
||||||
this.tinode.onDisconnect = this.handleDisconnect;
|
this.tinode.onConnect = this.handleConnected;
|
||||||
this.tinode.onAutoreconnectIteration = this.handleAutoreconnectIteration;
|
this.tinode.onDisconnect = this.handleDisconnect;
|
||||||
HashNavigation.navigateTo('');
|
this.tinode.onAutoreconnectIteration = this.handleAutoreconnectIteration;
|
||||||
|
HashNavigation.navigateTo('');
|
||||||
|
})
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
handleDeleteAccount() {
|
handleDeleteAccount() {
|
||||||
|
|||||||
+12
-6
@@ -6753,19 +6753,25 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
|
|||||||
}
|
}
|
||||||
|
|
||||||
clearInterval(this.reconnectCountdown);
|
clearInterval(this.reconnectCountdown);
|
||||||
|
let cleared;
|
||||||
|
|
||||||
if (this.tinode) {
|
if (this.tinode) {
|
||||||
this.tinode.clearStorage();
|
cleared = this.tinode.clearStorage();
|
||||||
this.tinode.onDisconnect = undefined;
|
this.tinode.onDisconnect = undefined;
|
||||||
this.tinode.disconnect();
|
this.tinode.disconnect();
|
||||||
|
} else {
|
||||||
|
cleared = Promose.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setState(this.getBlankState());
|
this.setState(this.getBlankState());
|
||||||
this.tinode = TinodeWeb.tnSetup(this.state.serverAddress, this.state.transport, this.props.intl.locale, _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_15__["default"].getObject('keep-logged-in'));
|
cleared.then(() => {
|
||||||
this.tinode.onConnect = this.handleConnected;
|
this.tinode = TinodeWeb.tnSetup(this.state.serverAddress, this.state.transport, this.props.intl.locale, _lib_local_storage_js__WEBPACK_IMPORTED_MODULE_15__["default"].getObject('keep-logged-in'), () => {
|
||||||
this.tinode.onDisconnect = this.handleDisconnect;
|
this.tinode.onConnect = this.handleConnected;
|
||||||
this.tinode.onAutoreconnectIteration = this.handleAutoreconnectIteration;
|
this.tinode.onDisconnect = this.handleDisconnect;
|
||||||
_lib_navigation_js__WEBPACK_IMPORTED_MODULE_16__["default"].navigateTo('');
|
this.tinode.onAutoreconnectIteration = this.handleAutoreconnectIteration;
|
||||||
|
_lib_navigation_js__WEBPACK_IMPORTED_MODULE_16__["default"].navigateTo('');
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
handleDeleteAccount() {
|
handleDeleteAccount() {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+35
-14
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user