Skip to content

Commit 9c19369

Browse files
committed
disallow persistent log
1 parent 46524ec commit 9c19369

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

app/AppInit.jsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ import {HashRouter, BrowserRouter} from "react-router-dom";
2525

2626
const Router = __HASH_HISTORY__ ? HashRouter : BrowserRouter;
2727

28+
// DEPRECATED / WARNING: this is deactivated because there is a race condition for some components when log is saved,
29+
// since it calls setState. If the subcomponent does not have a tailored rerendering logic, this may a WSOD
30+
const allowPersistentLog = false;
31+
2832
class RootIntl extends React.Component {
2933
UNSAFE_componentWillMount() {
3034
IntlActions.switchLocale(this.props.locale);
@@ -67,7 +71,11 @@ class AppInit extends React.Component {
6771
* @param error
6872
*/
6973
componentDidCatch(error) {
70-
this.saveExtendedLog("error", [error]);
74+
if (this.persistentLogEnabled) {
75+
this.saveExtendedLog("error", [error]);
76+
} else {
77+
console.error(error);
78+
}
7179
}
7280

7381
componentDidUpdate(nextProps, nextState) {
@@ -97,6 +105,7 @@ class AppInit extends React.Component {
97105
}
98106

99107
_enablePersistingLog() {
108+
if (!allowPersistentLog) return;
100109
if (this.persistentLogEnabled) return;
101110

102111
if (!this.state.extendeLogText.length) {

0 commit comments

Comments
 (0)