+
+
@@ -192,6 +260,7 @@ export default {
return {
importantInfo: t('mail', 'Messages will automatically be marked as important based on which messages you interacted with or marked as important. In the beginning you might have to manually change the importance to teach the system, but it will improve over time.'),
+ favoritesInfo: t('mail', 'Messages that your mark as favorite will be shown at the top of folders. You can disable this behavior in the app settings'),
followupInfo: t('mail', 'Messages sent by you that require a reply but did not receive one after a couple of days will be shown here.'),
bus: mitt(),
searchQuery: undefined,
@@ -207,6 +276,8 @@ export default {
priorityImportantQuery,
priorityOtherQuery,
+ favoriteQuery: 'is:starred',
+ favoriteInitialPageSize: 5,
startMailboxTimer: undefined,
hasContent: false,
}
@@ -272,6 +343,14 @@ export default {
return envelopes.length > 0
},
+ hasFavoriteEnvelopes() {
+ const envelopes = this.mainStore.getEnvelopes(
+ this.unifiedInbox.databaseId,
+ this.appendToSearch(this.favoriteQuery),
+ )
+ return envelopes.length > 0
+ },
+
/**
* @return {boolean}
*/
@@ -365,6 +444,8 @@ export default {
},
async mounted() {
+ // TODO: check the user preference
+ this.searchQuery = 'not:starred'
setTimeout(this.saveStartMailbox, START_MAILBOX_DEBOUNCE)
if (this.isThreadShown) {
await this.fetchEnvelopes()
@@ -414,6 +495,10 @@ export default {
if (this.searchQuery === undefined) {
return str
}
+ // Todo: adjust once we have the user prefeference
+ if (str === this.favoriteQuery && this.searchQuery.includes('not:starred')) {
+ return this.searchQuery.replace('not:starred', str)
+ }
return this.searchQuery + ' ' + str
},