]> git.codecow.com Git - libnemo.git/commitdiff
Update error thrown by lack of transient activation.
authorChris Duncan <chris@zoso.dev>
Thu, 30 Apr 2026 19:35:43 +0000 (12:35 -0700)
committerChris Duncan <chris@zoso.dev>
Thu, 30 Apr 2026 19:35:43 +0000 (12:35 -0700)
src/lib/block.ts
src/lib/tools.ts

index d57ccc0d6b641d83bd9ef08cbae5b3f76619d3b4..f59b040daafbabf2085ca5586cebcd1c0da9a5aa 100644 (file)
@@ -406,7 +406,10 @@ export class Block {
        async sign (wallet: Wallet, index: number, frontier?: Block): Promise<Block>
        sign (input: unknown, index?: unknown, frontier?: unknown): Block | Promise<Block> {
                if (navigator.userActivation?.isActive === false) {
-                       throw new Error('Signing request was blocked due to lack of user activation.')
+                       throw new DOMException(
+                               'Signing request was blocked due to lack of user activation',
+                               'NotAllowedError'
+                       )
                }
                if (typeof input === 'string' && /^[A-F0-9]{128}$/i.test(input)) {
                        this.signature = input
index 55849dd7711e9251861bf2048c1fc9448861c1cb..dc55b3b6c251935fc73bb521305a345516646a9d 100644 (file)
@@ -147,7 +147,10 @@ export class Tools {
         */
        static sign (secretKey: string | ArrayBuffer | Uint8Array<ArrayBuffer>, ...input: string[]): string {
                if (navigator.userActivation?.isActive === false) {
-                       throw new Error('Signing request was blocked due to lack of user activation.')
+                       throw new DOMException(
+                               'Signing request was blocked due to lack of user activation',
+                               'NotAllowedError'
+                       )
                }
                const k = this.#normalize(secretKey)
                try {