]> git.codecow.com Git - libnemo.git/commitdiff
Require 10-second minimum vault timeout.
authorChris Duncan <chris@zoso.dev>
Wed, 10 Sep 2025 20:54:58 +0000 (13:54 -0700)
committerChris Duncan <chris@zoso.dev>
Wed, 10 Sep 2025 20:54:58 +0000 (13:54 -0700)
src/lib/vault/vault-worker.ts

index f2a2d02393813faec67ed571503a0af89bac51b3..c18fcefb637fc13dea7d90667585ff39e985ec39 100644 (file)
@@ -123,11 +123,11 @@ export class VaultWorker {
                                throw new Error('Wallet is locked')
                        }
                        if (typeof timeout === 'number') {
-                               if (timeout < 0) {
-                                       throw new RangeError('Timeout must be non-negative')
+                               if (timeout < 10) {
+                                       throw new RangeError('Timeout must be at least 10 seconds')
                                }
                                if (timeout > 600) {
-                                       throw new RangeError('Maximum timeout is 10 minutes')
+                                       throw new RangeError('Timeout must be at most 10 minutes')
                                }
                                this.#timeout = timeout * 1000
                                this.#timer = new VaultTimer(() => this.lock(), this.#timeout)