Адаптировал чтобы работало вне плагина
This commit is contained in:
parent
46172dace0
commit
6e5b768904
@ -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…
Reference in New Issue
Block a user