bump(electron): 0.29.2 and a few minor bug fixes

Summary:
Saving only 50 models at a time instead of 100 fixes a reproducible issue with database errors during initial sync on my machine. With 100, it reports "unexpected ; on line 2123..." during the query.

Only the main window should update the unread badge count.

Test Plan: Tests still pass and it seems like everything is still functional.

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1736
This commit is contained in:
Ben Gotow 2015-07-13 16:28:06 -07:00
parent 57c96dcdd8
commit f11bbe313a
3 changed files with 20 additions and 13 deletions

View file

@ -11,7 +11,7 @@
"bugs": {
"url": "https://github.com/nylas/edgehill/issues"
},
"electronVersion": "0.28.1",
"electronVersion": "0.29.2",
"dependencies": {
"asar": "^0.5.0",
"6to5-core": "^3.5",

View file

@ -387,10 +387,10 @@ class DatabaseStore extends NylasStore
# Avoid trying to write too many objects a time - sqlite can only handle
# value sets `(?,?)...` of less than SQLITE_MAX_COMPOUND_SELECT (500),
# and we don't know ahead of time whether we'll hit that or not.
if models.length > 100
if models.length > 50
return Promise.all([
@_writeModels(models[0..99])
@_writeModels(models[100..models.length])
@_writeModels(models[0..49])
@_writeModels(models[50..models.length])
])
klass = models[0].constructor

View file

@ -29,7 +29,7 @@ UnreadCountStore = Reflux.createStore
@_onDataChanged()
_onDataChanged: (change) ->
return app.dock?.setBadge?("") unless NamespaceStore.current()
return @_setBadge("") unless NamespaceStore.current()
if change && change.objectClass is Thread.name
@_fetchCountDebounced ?= _.debounce(@_fetchCount, 5000)
@ -46,14 +46,21 @@ UnreadCountStore = Reflux.createStore
]).then (count) =>
return if @_count is count
@_count = count
if count > 999
app.dock?.setBadge?("999+")
else if count > 0
app.dock?.setBadge?("#{count}")
else
app.dock?.setBadge?("")
@_updateBadgeForCount(count)
@trigger()
.catch (err) =>
console.warn("Failed to fetch unread count: #{err}")
_updateBadgeForCount: (count) ->
return unless atom.isMainWindow()
if count > 999
@_setBadge("999+")
else if count > 0
@_setBadge("#{count}")
else
@_setBadge("")
_setBadge: (val) ->
app.dock?.setBadge?(val)
module.exports = UnreadCountStore