mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-10 10:17:11 +03:00
Merge pull request #11397 from atom/fix-reading-cached-status-from-within-callback
Defer the callback to the next tick.
This commit is contained in:
commit
618bba307c
@ -166,7 +166,12 @@ class GitRepository
|
||||
#
|
||||
# Returns a {Disposable} on which `.dispose()` can be called to unsubscribe.
|
||||
onDidChangeStatuses: (callback) ->
|
||||
@async.onDidChangeStatuses callback
|
||||
@async.onDidChangeStatuses ->
|
||||
# Defer the callback to the next tick so that we've reset
|
||||
# `@statusesByPath` by the time it's called. Otherwise reads from within
|
||||
# the callback could be inconsistent.
|
||||
# See https://github.com/atom/atom/issues/11396
|
||||
process.nextTick callback
|
||||
|
||||
###
|
||||
Section: Repository Details
|
||||
|
Loading…
Reference in New Issue
Block a user