]> git.codecow.com Git - libnemo.git/commitdiff
Fix tsc complaint about ArrayBufferLike.
authorChris Duncan <chris@zoso.dev>
Wed, 10 Sep 2025 04:26:36 +0000 (21:26 -0700)
committerChris Duncan <chris@zoso.dev>
Wed, 10 Sep 2025 04:26:36 +0000 (21:26 -0700)
src/lib/vault/vault-worker.ts

index 42f84fa42ab3b09e9a867a86105fe63a6dfc3d75..c9ac8bec19c49107011f649191e38e7726ed45b2 100644 (file)
@@ -497,7 +497,7 @@ export class VaultWorker {
                                if (type === 'BLAKE2b') {
                                        seed = Bip39.fromEntropy(new Uint8Array(secret))
                                                .then(bip39 => {
-                                                       this.#mnemonic = this.#encoder.encode(bip39.phrase ?? '').buffer
+                                                       this.#mnemonic = new Uint8Array(this.#encoder.encode(bip39.phrase ?? '')).buffer
                                                        return secret
                                                })
                                } else {
@@ -506,7 +506,7 @@ export class VaultWorker {
                        } else {
                                seed = Bip39.fromPhrase(secret)
                                        .then(bip39 => {
-                                               this.#mnemonic = this.#encoder.encode(bip39.phrase ?? '').buffer
+                                               this.#mnemonic = new Uint8Array(this.#encoder.encode(bip39.phrase ?? '')).buffer
                                                const derive = type === 'BIP-44'
                                                        ? bip39.toBip39Seed(mnemonicSalt ?? '')
                                                        : Promise.resolve(bip39.toBlake2bSeed())