Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Cleanup #28

Merged
merged 3 commits into from
Nov 4, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Wait for initial packages to load before populating
  • Loading branch information
Wliu authored and Wliu committed Nov 4, 2017
commit 35c825ce3928636a7ee243efdef300373f58821c
5 changes: 2 additions & 3 deletions lib/timecop-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ export default class TimecopView {
constructor ({uri}) {
this.uri = uri
etch.initialize(this)
if (atom.packages.getActivePackages().length > 0) {
if (atom.packages.hasActivatedInitialPackages()) {
this.populateViews()
} else {
// Render on next tick so packages have been activated
setImmediate(() => { this.populateViews() })
atom.packages.onDidActivateInitialPackages(() => this.populateViews())
}
}

Expand Down
1 change: 1 addition & 0 deletions spec/timecop-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ describe('Timecop', () => {

spyOn(atom.packages, 'getLoadedPackages').andReturn(packages)
spyOn(atom.packages, 'getActivePackages').andReturn(packages)
spyOn(atom.packages, 'hasActivatedInitialPackages').andReturn(true)

timecopView = await atom.workspace.open('atom://timecop')
})
Expand Down