From 9ddcc88cf39f21ad8c380b9ab13f4f5e89f9ab0f Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Sat, 4 Nov 2017 18:19:28 +0100 Subject: [PATCH 1/3] :fire: optional methods --- lib/timecop-view.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lib/timecop-view.js b/lib/timecop-view.js index e71355e..ae23cf5 100644 --- a/lib/timecop-view.js +++ b/lib/timecop-view.js @@ -3,7 +3,6 @@ import _ from 'underscore-plus' import dedent from 'dedent' -import {Disposable} from 'atom' import etch from 'etch' import CachePanelView from './cache-panel-view' import PackagePanelView from './package-panel-view' @@ -127,12 +126,4 @@ export default class TimecopView { getIconName () { return 'dashboard' } - - onDidChangeTitle () { - return new Disposable(function () {}) - } - - onDidChangeModified () { - return new Disposable(function () {}) - } } From 35c825ce3928636a7ee243efdef300373f58821c Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Sat, 4 Nov 2017 18:23:16 +0100 Subject: [PATCH 2/3] Wait for initial packages to load before populating --- lib/timecop-view.js | 5 ++--- spec/timecop-spec.js | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/timecop-view.js b/lib/timecop-view.js index ae23cf5..7488e91 100644 --- a/lib/timecop-view.js +++ b/lib/timecop-view.js @@ -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()) } } diff --git a/spec/timecop-spec.js b/spec/timecop-spec.js index d06273e..4131206 100644 --- a/spec/timecop-spec.js +++ b/spec/timecop-spec.js @@ -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') }) From 153de76fb211a3b078b42dcdc8029e146952ac6d Mon Sep 17 00:00:00 2001 From: Wliu <50Wliu@users.noreply.github.com> Date: Sat, 4 Nov 2017 18:43:04 +0100 Subject: [PATCH 3/3] =?UTF-8?q?Show=20'Loading=E2=80=A6'=20as=20a=20placeh?= =?UTF-8?q?older=20before=20info=20is=20populated?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/cache-panel-view.js | 15 ++++++++++----- lib/package-panel-view.js | 2 +- lib/window-panel-view.js | 10 +++++----- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/lib/cache-panel-view.js b/lib/cache-panel-view.js index c4b8386..1ad15b1 100644 --- a/lib/cache-panel-view.js +++ b/lib/cache-panel-view.js @@ -23,27 +23,27 @@ export default class CachePanelView {
CoffeeScript files compiled - 0 + Loading…
Babel files compiled - + Loading…
Typescript files compiled - + Loading…
CSON files compiled - + Loading…
Less files compiled - + Loading…
@@ -54,12 +54,17 @@ export default class CachePanelView { populate () { const compileCacheStats = this.getCompileCacheStats() if (compileCacheStats) { + this.refs.coffeeCompileCount.classList.add('highlight-info') this.refs.coffeeCompileCount.textContent = compileCacheStats['.coffee'].misses + this.refs.babelCompileCount.classList.add('highlight-info') this.refs.babelCompileCount.textContent = compileCacheStats['.js'].misses + this.refs.typescriptCompileCount.classList.add('highlight-info') this.refs.typescriptCompileCount.textContent = compileCacheStats['.ts'].misses } + this.refs.csonCompileCount.classList.add('highlight-info') this.refs.csonCompileCount.textContent = this.getCsonCompiles() + this.refs.lessCompileCount.classList.add('highlight-info') this.refs.lessCompileCount.textContent = this.getLessCompiles() } diff --git a/lib/package-panel-view.js b/lib/package-panel-view.js index f555a0e..8cbb0be 100644 --- a/lib/package-panel-view.js +++ b/lib/package-panel-view.js @@ -32,7 +32,7 @@ export default class PackagePanelView {
{this.title}
-
+
Loading…
diff --git a/lib/window-panel-view.js b/lib/window-panel-view.js index d80435a..4b631ee 100644 --- a/lib/window-panel-view.js +++ b/lib/window-panel-view.js @@ -31,28 +31,28 @@ export default class WindowPanelView {
Window load time - + Loading…
Shell load time - + Loading…
Workspace load time - + Loading…
Project load time - + Loading…
Window state load time - + Loading…