|
|
|
@ -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) |
|
|
|
|
}) |
|
|
|
|