mirror of
https://github.com/mattermost/mattermost.git
synced 2026-10-28 02:36:08 +08:00
PLT-2952 fixing preview mode error message (#3113)
This commit is contained in:
committed by
Joram Wilander
parent
510fc33fd9
commit
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();
|
||||
|
||||
Reference in New Issue
Block a user