Skip to content

Commit f89b5eb

Browse files
authored
Merge pull request #13 from kaloudis/cipher-salt-check
lnc-web: don't create salt and test cipher if onLocal and onRemote defined
2 parents 5719c4a + f700bac commit f89b5eb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,15 @@ export default class LNC {
119119

120120
if (localStorage.getItem(`${this._namespace}:salt`)) {
121121
this.salt = localStorage.getItem(`${this._namespace}:salt`) || '';
122-
} else {
122+
} else if (!this._onLocalPrivCreate && !this._onRemoteKeyReceive) {
123123
this.salt = generateSalt();
124124
localStorage.setItem(`${this._namespace}:salt`, this.salt);
125125
}
126126

127127
if (localStorage.getItem(`${this._namespace}:testCipher`)) {
128128
this.testCipher =
129129
localStorage.getItem(`${this._namespace}:testCipher`) || '';
130-
} else {
130+
} else if (!this._onLocalPrivCreate && !this._onRemoteKeyReceive) {
131131
this.testCipher = createTestCipher(this._password, this.salt);
132132
localStorage.setItem(
133133
`${this._namespace}:testCipher`,

0 commit comments

Comments
 (0)