From 9f74cc3f6cedb2e1f2f7256ccf816741adc8ca68 Mon Sep 17 00:00:00 2001
From: Kirill Pimenov
Date: Mon, 27 Jul 2026 16:57:41 +0200
Subject: [PATCH] fix: apply the same shard-count validation to the generator
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Share.vue's shard-count input had the defect Copilot flagged on Print.vue's:
no `step`, no integer check, and `totalShards` fed straight into
crypto.share() — a fractional count surfaced as an opaque secrets.js error
routed through the generic error hub, and an emptied box passed "" through.
Reuse `isValidShardCount()` and gate the generate button on it, matching the
existing `secretTooLong` pattern (disabled button plus an inline error span),
so both shard-count inputs now agree on what a shard count is.
---
src/views/Share.vue | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/views/Share.vue b/src/views/Share.vue
index 65c44e8..dae2687 100644
--- a/src/views/Share.vue
+++ b/src/views/Share.vue
@@ -39,13 +39,18 @@
type="number"
min="3"
max="255"
+ step="1"
/>
to reconstruct
+
+
+ Enter a whole number of shards between 3 and 255
+