Remove remaining traces of localStorage
Add window.storage to the background page, which loads all data from the 'items' store in indexeddb, caching them in memory for synchronous access, then override textsecure storage to use that in memory store.
This commit is contained in:
parent
a3c5b0959f
commit
3f37cd21a9
7 changed files with 177 additions and 140 deletions
|
@ -20,16 +20,16 @@
|
|||
Whisper.Notifications = {
|
||||
isEnabled: function(callback) {
|
||||
return Notification.permission === 'granted' &&
|
||||
!localStorage.getItem('disable-notifications');
|
||||
!storage.get('disable-notifications');
|
||||
},
|
||||
enable: function(callback) {
|
||||
localStorage.removeItem('disable-notifications');
|
||||
storage.remove('disable-notifications');
|
||||
Notification.requestPermission(function(status) {
|
||||
callback(status);
|
||||
});
|
||||
},
|
||||
disable: function() {
|
||||
localStorage.setItem('disable-notifications', true);
|
||||
storage.put('disable-notifications', true);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue