Адаптировал чтобы работало вне плагина

master
Sipachev Igor 3 years ago
parent 46172dace0
commit 6e5b768904
  1. 6
      popup/src/classes/Service/NotificationCleaner.ts
  2. 5
      popup/src/components/script.ts
  3. 4
      popup/src/components/template.html

@ -1,19 +1,19 @@
export class NotificationCleaner {
enable () {
chrome.storage.sync.set({ 'need-clean-notification': true }, function () {
chrome.storage && chrome.storage.sync.set({ 'need-clean-notification': true }, function () {
console.log('need-clean-notification: ' + true)
})
}
disable () {
chrome.storage.sync.set({ 'need-clean-notification': false }, function () {
chrome.storage && chrome.storage.sync.set({ 'need-clean-notification': false }, function () {
console.log('need-clean-notification: ' + false)
})
}
state (): Promise<boolean> {
return new Promise((resolve, reject) => {
chrome.storage.sync.get(['need-clean-notification'], function (result) {
chrome.storage && chrome.storage.sync.get(['need-clean-notification'], function (result) {
console.log('Value currently is ' + result['need-clean-notification'])
resolve(result['need-clean-notification'] || false)
})

@ -17,4 +17,9 @@ Vue.use(VueClipboard)
})
export default class HelloWorld extends Vue {
tab = 'person'
isPlugin (): boolean {
console.log(chrome)
return !!chrome.tabs
}
}

@ -7,7 +7,7 @@
<div @click="personalId=''; tab = 'mocks'" class="tab-panel__item" :class="{'tab-panel__item_active': tab === 'mocks'}">
Mocks
</div>
<div @click="tab = 'ember'" class="tab-panel__item" :class="{'tab-panel__item_active': tab === 'ember'}">
<div v-if="isPlugin()" @click="tab = 'ember'" class="tab-panel__item" :class="{'tab-panel__item_active': tab === 'ember'}">
Ember
</div>
</div>
@ -18,7 +18,7 @@
<div class="tab-page__item" :class="{'tab-page__item_show': tab === 'mocks'}">
<MocksTab/>
</div>
<div class="tab-page__item" :class="{'tab-page__item_show': tab === 'ember'}">
<div v-if="isPlugin()" class="tab-page__item" :class="{'tab-page__item_show': tab === 'ember'}">
<EmberTab/>
</div>
</div>

Loading…
Cancel
Save