Commit 3042f599 authored by MrMan's avatar MrMan

Fixes #34, Log user out if credential or invalid sentiment error appears

parent e64bd600
Pipeline #2498226 skipped
......@@ -87,6 +87,11 @@ let TinderSentimentStore = Reflux.createStore({
// Exit early if not all necessary credentials are available yet
if (!this.hasNecessaryCredentials() || !sentimentIsValid(sentiment)) {
reject(new Error("Missing credentials or invalid sentiment"));
// Logout if the user doesn't have necessary credentials
if (!this.hasNecessaryCredentials()) {
Actions.logout();
}
return;
}
......
......@@ -51,7 +51,9 @@ let TinderUpdateStore = Reflux.createStore({
retrieveTinderUpdates() {
// Exit early if not all necessary credentials are available yet
if (!this.hasNecessaryCredentials()) {
reject(new Error("Missing credentials or invalid sentiment"));
reject(new Error("Missing credentials"));
// If the user was unable to receive updates from Tinder, might as well just log them out
Actions.logout();
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment