mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-11 18:32:20 +08:00
fix(empty): Use a much faster query for empty perspective
This commit is contained in:
parent
471bbbe1e3
commit
2f3bc020a1
1 changed files with 5 additions and 1 deletions
|
@ -200,7 +200,11 @@ class EmptyMailboxPerspective extends MailboxPerspective
|
|||
@accountIds = []
|
||||
|
||||
threads: =>
|
||||
query = DatabaseStore.findAll(Thread).where(accountId: -1).limit(0)
|
||||
# We need a Thread query that will not return any results and take no time.
|
||||
# We use lastMessageReceivedTimestamp because it is the first column on an
|
||||
# index so this returns zero items nearly instantly. In the future, we might
|
||||
# want to make a Query.forNothing() to go along with MailboxPerspective.forNothing()
|
||||
query = DatabaseStore.findAll(Thread).where(lastMessageReceivedTimestamp: -1).limit(0)
|
||||
return new MutableQuerySubscription(query, {asResultSet: true})
|
||||
|
||||
canReceiveThreadsFromAccountIds: =>
|
||||
|
|
Loading…
Reference in a new issue