PLT-2952 fixing preview mode error message (#3113)
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
510fc33fd9
Коммит
7b2538fc6c
@@ -58,7 +58,12 @@ export default class ErrorBar extends React.Component {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
ErrorStore.clearLastError();
|
||||
if (ErrorStore.getLastError() && ErrorStore.getLastError().email_preview) {
|
||||
ErrorStore.clearPreviewError();
|
||||
} else {
|
||||
ErrorStore.clearLastError();
|
||||
}
|
||||
|
||||
this.setState({message: null});
|
||||
}
|
||||
|
||||
|
||||
@@ -64,8 +64,10 @@ class ErrorStoreClass extends EventEmitter {
|
||||
|
||||
clearLastError() {
|
||||
var lastError = this.getLastError();
|
||||
|
||||
// preview message can only be cleared by clearPreviewError
|
||||
if (lastError && lastError.email_preview) {
|
||||
this.ignore_email_preview = true;
|
||||
return;
|
||||
}
|
||||
|
||||
BrowserStore.removeGlobalItem('last_error');
|
||||
@@ -74,6 +76,12 @@ class ErrorStoreClass extends EventEmitter {
|
||||
this.emitChange();
|
||||
}
|
||||
}
|
||||
|
||||
clearPreviewError() {
|
||||
this.ignore_email_preview = true;
|
||||
this.storeLastError('');
|
||||
this.clearLastError();
|
||||
}
|
||||
}
|
||||
|
||||
var ErrorStore = new ErrorStoreClass();
|
||||
|
||||
Ссылка в новой задаче
Block a user