PLT-2952 fixing preview mode error message (#3113)

This commit is contained in:
Corey Hulen
2016-05-26 07:54:49 -04:00
committed by Joram Wilander
parent 510fc33fd9
commit 7b2538fc6c
2 changed files with 15 additions and 2 deletions
+6 -1
View File
@@ -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});
}
+9 -1
View File
@@ -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();