voidlogue-crypto 2.0.3 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/vault.ts +10 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "voidlogue-crypto",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"description": "Open-source client-side cryptographic primitives for Voidlogue — published for independent audit and verification of privacy claims.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
package/src/vault.ts
CHANGED
|
@@ -175,8 +175,13 @@ export const Vault = {
|
|
|
175
175
|
|
|
176
176
|
localStorage.setItem(`voidlogue_conv_${roomHash}`, JSON.stringify(blob));
|
|
177
177
|
|
|
178
|
-
|
|
179
|
-
|
|
178
|
+
// Only add labelled conversations to the index.
|
|
179
|
+
// Ghost (unlabelled) convos are stored in localStorage under their key
|
|
180
|
+
// but must NOT appear in the convlist so they stay hidden from the UI.
|
|
181
|
+
if (hint.trim()) {
|
|
182
|
+
const labelEntry = await encryptLabel(hint, key);
|
|
183
|
+
await this._updateIndex(roomHash, labelEntry);
|
|
184
|
+
}
|
|
180
185
|
return true;
|
|
181
186
|
},
|
|
182
187
|
|
|
@@ -257,12 +262,14 @@ export const Vault = {
|
|
|
257
262
|
newPin: string
|
|
258
263
|
): Promise<boolean> {
|
|
259
264
|
const entry = this._getEncryptedHint(roomHash);
|
|
265
|
+
// entry is always an object ({encrypted:'', iv:'', …}) for unlabelled convos,
|
|
266
|
+
// so we must check entry?.encrypted (non-empty string) — not just entry.
|
|
260
267
|
return this.save(
|
|
261
268
|
roomHash,
|
|
262
269
|
email,
|
|
263
270
|
codename,
|
|
264
271
|
newPin,
|
|
265
|
-
entry ? '(restored)' : ''
|
|
272
|
+
entry?.encrypted ? '(restored)' : ''
|
|
266
273
|
);
|
|
267
274
|
},
|
|
268
275
|
|