move registration.js to ts

pull/2239/head
Audric Ackermann 3 years ago
parent 0d4059ccb1
commit 6334f7cb45
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -107,6 +107,7 @@
// Ensure accounts created prior to 1.0.0-beta8 do have their
// 'primaryDevicePubKey' defined.
if (Whisper.Registration.isDone() && !storage.get('primaryDevicePubKey', null)) {
storage.put(
'primaryDevicePubKey',

@ -1,28 +0,0 @@
/* global storage, Whisper */
// eslint-disable-next-line func-names
(function() {
'use strict';
Whisper.Registration = {
markEverDone() {
storage.put('chromiumRegistrationDoneEver', '');
},
markDone() {
this.markEverDone();
storage.put('chromiumRegistrationDone', '');
},
isDone() {
return storage.get('chromiumRegistrationDone') === '';
},
everDone() {
return (
storage.get('chromiumRegistrationDoneEver') === '' ||
storage.get('chromiumRegistrationDone') === ''
);
},
remove() {
storage.remove('chromiumRegistrationDone');
},
};
})();

@ -0,0 +1,21 @@
function markEverDone() {
storage.put('chromiumRegistrationDoneEver', '');
}
function markDone() {
this.markEverDone();
storage.put('chromiumRegistrationDone', '');
}
function isDone() {
return storage.get('chromiumRegistrationDone') === '';
}
function everDone() {
return (
storage.get('chromiumRegistrationDoneEver') === '' ||
storage.get('chromiumRegistrationDone') === ''
);
}
function remove() {
storage.remove('chromiumRegistrationDone');
}
export const Registration = { markEverDone, markDone, isDone, everDone, remove };
Loading…
Cancel
Save