Permalink
Browse files

Readded the inbox configuration screen when adding an account. Better…

… resilience for invalid token
  • Loading branch information...
1 parent a1ced7c commit c4368fcb140e67e4eb3e294974f205aa65fc6ed0 @Thomas101 committed Mar 1, 2017
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -78,7 +78,7 @@ class GoogleStore {
*/
isInvalidGrantError (err) {
if (err && typeof (err.message) === 'string') {
- if (err.message.indexOf('invalid_grant') !== -1) {
+ if (err.message.indexOf('invalid_grant') !== -1 || err.message.indexOf('Invalid Credentials') !== -1) {
return true
}
}
@@ -21,14 +21,16 @@ configurations[Mailbox.TYPE_GMAIL] = {
}
}
configurations[Mailbox.TYPE_GINBOX] = {
- COUNT_SCRAPE: {
+ UNREAD_INBOX: {
googleConf: {
- takeLabelCountFromUI: true
+ takeLabelCountFromUI: false,
+ unreadMode: Google.UNREAD_MODES.INBOX_UNREAD
}
},
- COUNT_API: {
+ DEFAULT_INBOX: {
googleConf: {
- takeLabelCountFromUI: false
+ takeLabelCountFromUI: false,
+ unreadMode: Google.UNREAD_MODES.GINBOX_DEFAULT
}
}
}
@@ -162,18 +162,7 @@ class MailboxWizardStore {
googleAuth: auth
}
- if (type === Mailbox.TYPE_GMAIL) {
- this.configurationOpen = true
- } else if (type === Mailbox.TYPE_GINBOX) {
- if (pkg.prerelease) {
- this.configureServicesOpen = true
- } else {
- this.createMailbox()
- this.completeClear()
- this.configurationCompleteOpen = true
- }
- }
-
+ this.configurationOpen = true
this.emitChange()
}
}).catch((err) => {
@@ -85,35 +85,34 @@ module.exports = React.createClass({
<div style={styles.configurations}>
<Paper
style={styles.configuration}
- onClick={() => onPickedConfiguration(Configurations[Mailbox.TYPE_GINBOX].COUNT_SCRAPE)}>
+ onClick={() => onPickedConfiguration(Configurations[Mailbox.TYPE_GINBOX].DEFAULT_INBOX)}>
<div>
- <RaisedButton primary label='Inbox Zero (Default)' style={styles.configurationButton} />
+ <RaisedButton primary label='Unread Bundled Messages (Default)' style={styles.configurationButton} />
<div style={Object.assign({
- backgroundImage: `url("../../images/ginbox_mode_zero_small.png")`
+ backgroundImage: `url("../../images/ginbox_mode_unreadunbundled.png")`
}, styles.configurationImage)} />
<p>
- I like to read all my emails and mark them as done so that I only
- have a few emails in my inbox
+ I'm only interested in messages in my inbox that aren't in bundles.
+ This is default behaviour also seen in the iOS and Android Inbox Apps
</p>
<p style={styles.configurationTechInfo}>
- This will take the unread count from the user interface
+ Unread Unbundled Messages in Inbox
</p>
</div>
</Paper>
<Paper
style={styles.configuration}
- onClick={() => onPickedConfiguration(Configurations[Mailbox.TYPE_GINBOX].COUNT_API)}>
+ onClick={() => onPickedConfiguration(Configurations[Mailbox.TYPE_GINBOX].UNREAD_INBOX)}>
<div>
- <RaisedButton primary label='Full Inbox' style={styles.configurationButton} />
+ <RaisedButton primary label='All Unread Messages' style={styles.configurationButton} />
<div style={Object.assign({
- backgroundImage: `url("../../images/ginbox_mode_full_small.png")`
+ backgroundImage: `url("../../images/ginbox_mode_inbox.png")`
}, styles.configurationImage)} />
<p>
- I leave all my emails in my inbox and just deal with the new ones
- as they arrive
+ I'm interested in all unread messages in my inbox
</p>
<p style={styles.configurationTechInfo}>
- This will take the unread count the Gmail API
+ Unread Messages in Inbox
</p>
</div>
</Paper>

0 comments on commit c4368fc

Please sign in to comment.