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

Этот коммит содержится в:
Corey Hulen
2016-05-26 04:54:49 -07:00
коммит произвёл Joram Wilander
родитель 510fc33fd9
Коммит 7b2538fc6c
2 изменённых файлов: 15 добавлений и 2 удалений

Просмотреть файл

@@ -58,7 +58,12 @@ export default class ErrorBar extends React.Component {
e.preventDefault(); e.preventDefault();
} }
ErrorStore.clearLastError(); if (ErrorStore.getLastError() && ErrorStore.getLastError().email_preview) {
ErrorStore.clearPreviewError();
} else {
ErrorStore.clearLastError();
}
this.setState({message: null}); this.setState({message: null});
} }

Просмотреть файл

@@ -64,8 +64,10 @@ class ErrorStoreClass extends EventEmitter {
clearLastError() { clearLastError() {
var lastError = this.getLastError(); var lastError = this.getLastError();
// preview message can only be cleared by clearPreviewError
if (lastError && lastError.email_preview) { if (lastError && lastError.email_preview) {
this.ignore_email_preview = true; return;
} }
BrowserStore.removeGlobalItem('last_error'); BrowserStore.removeGlobalItem('last_error');
@@ -74,6 +76,12 @@ class ErrorStoreClass extends EventEmitter {
this.emitChange(); this.emitChange();
} }
} }
clearPreviewError() {
this.ignore_email_preview = true;
this.storeLastError('');
this.clearLastError();
}
} }
var ErrorStore = new ErrorStoreClass(); var ErrorStore = new ErrorStoreClass();