mirror of
https://github.com/oxen-io/session-desktop.git
synced 2023-12-14 02:12:57 +01:00
move registration.js to ts
This commit is contained in:
parent
0d4059ccb1
commit
6334f7cb45
|
@ -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');
|
||||
},
|
||||
};
|
||||
})();
|
21
ts/util/registration.ts
Normal file
21
ts/util/registration.ts
Normal file
|
@ -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…
Reference in a new issue