Refactor registration event
Make AccountManager into an event target for better separation between app and service-library handling of registration events.
This commit is contained in:
parent
6dcff46e26
commit
7b3b01bdf6
6 changed files with 57 additions and 15 deletions
22
js/registration.js
Normal file
22
js/registration.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* vim: ts=4:sw=4:expandtab
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
Whisper.Registration = {
|
||||
markDone: function () {
|
||||
storage.put('chromiumRegistrationDoneEver', '');
|
||||
storage.put('chromiumRegistrationDone', '');
|
||||
},
|
||||
isDone: function () {
|
||||
return storage.get('chromiumRegistrationDone') === '';
|
||||
},
|
||||
everDone: function() {
|
||||
return storage.get('chromiumRegistrationDoneEver') === '' ||
|
||||
storage.get('chromiumRegistrationDone') === '';
|
||||
},
|
||||
remove: function() {
|
||||
storage.remove('chromiumRegistrationDone');
|
||||
}
|
||||
};
|
||||
}());
|
Loading…
Add table
Add a link
Reference in a new issue