Skip to content

Commit

Permalink
Merge pull request #26 from rhyek/feature-initialized
Browse files Browse the repository at this point in the history
feature: add initialized flag
  • Loading branch information
pabloascarza authored Jun 27, 2022
2 parents f06d865 + 290dd08 commit 538cb6e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions addon/initializers/master-tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export function initialize(application) {
application.register('service:master-tab', masterTab, { instantiate: false });
application.deferReadiness();
masterTab.setup().then(() => {
masterTab.initialized = true;
application.advanceReadiness();
});
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ember-master-tab",
"version": "1.4.0",
"version": "1.5.0",
"description": "A library that provides a service which helps running a function on only one tab of an Ember application.",
"keywords": [
"ember-addon",
Expand Down
12 changes: 6 additions & 6 deletions tests/dummy/app/templates/application.hbs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<h2 id="title">Ember Master Tab demo</h2>
<p>Is this the master tab? <strong>{{#if masterTab.isMasterTab}}Yes{{else}}No{{/if}}</strong></p>
<p>Is this the master tab? <strong>{{#if this.masterTab.isMasterTab}}Yes{{else}}No{{/if}}</strong></p>
<pre>
<strong>Current server time (lock)</strong> : {{serverTimeLock.currentTime}} <button disabled={{masterTab.isMasterTab}} {{action "updateTimeLock"}}>Update here</button>
<strong>Current server time (run)</strong> : {{serverTimeRun.currentTime}}
<strong>Current server time (sse)</strong> : {{serverTimeSse.currentTime}}
<strong>Current server time (lock)</strong> : {{this.serverTimeLock.currentTime}} <button type="button" disabled={{this.masterTab.isMasterTab}} {{action "updateTimeLock"}}>Update here</button>
<strong>Current server time (run)</strong> : {{this.serverTimeRun.currentTime}}
<strong>Current server time (sse)</strong> : {{this.serverTimeSse.currentTime}}

<strong>Counter [is master tab]</strong> : {{counterIsMasterTab}}
<strong>Counter [is not master tab]</strong>: {{counterIsNotMasterTab}}
<strong>Counter [is master tab]</strong> : {{this.counterIsMasterTab}}
<strong>Counter [is not master tab]</strong>: {{this.counterIsNotMasterTab}}
</pre>
{{outlet}}

0 comments on commit 538cb6e

Please sign in to comment.