mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-09 14:02:56 +09:00
fix(dashboard): guard clipboard copy in non-secure contexts
Address review feedback from gemini-code-assist on SecretsTab.tsx: guard the copy button on navigator.clipboard so it is disabled and a no-op when the API is unavailable (plain-HTTP contexts), instead of throwing a TypeError. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
This commit is contained in:
1 parent
83a8479169
commit
ea0c0ab1a3
1 file changed
+2
-2
+2
-2
@@ -96,8 +96,8 @@ function SecretRow({
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
disabled={!revealed}
|
||||
onClick={() => navigator.clipboard.writeText(fullValue)}
|
||||
disabled={!revealed || !navigator.clipboard}
|
||||
onClick={() => navigator.clipboard?.writeText(fullValue)}
|
||||
className="rounded p-1 text-slate-500 hover:bg-slate-100 disabled:opacity-30"
|
||||
title="Copy"
|
||||
>
|
||||
|
||||
Reference in new issue
Block a user