Адаптировал чтобы работало вне плагина
This commit is contained in:
parent
46172dace0
commit
6e5b768904
@ -1,19 +1,19 @@
|
|||||||
export class NotificationCleaner {
|
export class NotificationCleaner {
|
||||||
enable () {
|
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)
|
console.log('need-clean-notification: ' + true)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
disable () {
|
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)
|
console.log('need-clean-notification: ' + false)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
state (): Promise<boolean> {
|
state (): Promise<boolean> {
|
||||||
return new Promise((resolve, reject) => {
|
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'])
|
console.log('Value currently is ' + result['need-clean-notification'])
|
||||||
resolve(result['need-clean-notification'] || false)
|
resolve(result['need-clean-notification'] || false)
|
||||||
})
|
})
|
||||||
|
@ -17,4 +17,9 @@ Vue.use(VueClipboard)
|
|||||||
})
|
})
|
||||||
export default class HelloWorld extends Vue {
|
export default class HelloWorld extends Vue {
|
||||||
tab = 'person'
|
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'}">
|
<div @click="personalId=''; tab = 'mocks'" class="tab-panel__item" :class="{'tab-panel__item_active': tab === 'mocks'}">
|
||||||
Mocks
|
Mocks
|
||||||
</div>
|
</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
|
Ember
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -18,7 +18,7 @@
|
|||||||
<div class="tab-page__item" :class="{'tab-page__item_show': tab === 'mocks'}">
|
<div class="tab-page__item" :class="{'tab-page__item_show': tab === 'mocks'}">
|
||||||
<MocksTab/>
|
<MocksTab/>
|
||||||
</div>
|
</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/>
|
<EmberTab/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user