Skip to content

Commit 26f0f1d

Browse files
author
Llorenç
committed
Toggle all
1 parent 84b43a8 commit 26f0f1d

File tree

1 file changed

+16
-5
lines changed
  • src/frontend/src/routes/(new-styling)/recovery-phrase

1 file changed

+16
-5
lines changed

src/frontend/src/routes/(new-styling)/recovery-phrase/+page.svelte

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,13 @@
164164
}
165165
};
166166
167-
const handleShowAll = () => {
168-
showAll = true;
167+
const toggleAll = () => {
168+
showAll = !showAll;
169+
if (!showAll) {
170+
words.forEach((word) => {
171+
word.showContent = false;
172+
});
173+
}
169174
};
170175
171176
const handleClearAll = () => {
@@ -221,7 +226,9 @@
221226
<!-- "data-bwignore" Bitwarden ignore -->
222227
<!-- "data-form-type=other" Non-standard hint to password managers -->
223228
<input
224-
type={showAll || word.showContent ? "text" : "password"}
229+
type={showAll || word.showContent || !word.isValid
230+
? "text"
231+
: "password"}
225232
inputmode="text"
226233
autocorrect="off"
227234
autocomplete="off"
@@ -281,8 +288,12 @@
281288
{/each}
282289
</div>
283290
<div class="flex flex-row gap-2">
284-
<Button class="w-full" variant="tertiary" onclick={handleShowAll}>
285-
{$t`Show all`}
291+
<Button class="w-full" variant="tertiary" onclick={toggleAll}>
292+
{#if showAll}
293+
{$t`Hide all`}
294+
{:else}
295+
{$t`Show all`}
296+
{/if}
286297
</Button>
287298
<Button class="w-full" variant="tertiary" onclick={handleClearAll}>
288299
{$t`Clear all`}

0 commit comments

Comments
 (0)