1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-13 06:54:07 +00:00

consolidate @if statements, use @else where appropriate

This commit is contained in:
Brad Deibert
2026-01-20 09:35:10 -08:00
parent 350e109304
commit b5d77f53f4
6 changed files with 11 additions and 24 deletions

View File

@@ -16,19 +16,15 @@
<div class="tw-mt-4">
@if (error) {
<p>{{ "reportError" | i18n }}...</p>
}
@if (!error) {
} @else {
@if (!breachedAccounts.length) {
<bit-callout type="success" title="{{ 'goodNews' | i18n }}">
{{ "breachUsernameNotFound" | i18n: checkedUsername }}
</bit-callout>
}
@if (breachedAccounts.length) {
} @else {
<bit-callout type="danger" title="{{ 'breachFound' | i18n }}">
{{ "breachUsernameFound" | i18n: checkedUsername : breachedAccounts.length }}
</bit-callout>
}
@if (breachedAccounts.length) {
<ul
class="tw-list-none tw-flex-col tw-divide-x-0 tw-divide-y tw-divide-solid tw-divide-secondary-300 tw-rounded tw-border tw-border-solid tw-border-secondary-300 tw-p-0"
>

View File

@@ -11,8 +11,7 @@
<bit-callout type="success" title="{{ 'goodNews' | i18n }}">
{{ "noExposedPasswords" | i18n }}
</bit-callout>
}
@if (ciphers.length) {
} @else {
<bit-callout
type="danger"
title="{{ 'exposedPasswordsFound' | i18n }}"

View File

@@ -11,15 +11,13 @@
></i>
<span class="tw-sr-only">{{ "loading" | i18n }}</span>
</div>
}
@if (hasLoaded) {
} @else {
<div class="tw-mt-4">
@if (!ciphers.length) {
<bit-callout type="success" title="{{ 'goodNews' | i18n }}">
{{ "noInactive2fa" | i18n }}
</bit-callout>
}
@if (ciphers.length) {
} @else {
<bit-callout type="danger" title="{{ 'inactive2faFound' | i18n }}">
{{ "inactive2faFoundReportDesc" | i18n: (ciphers.length | number) : vaultMsg }}
</bit-callout>

View File

@@ -11,15 +11,13 @@
></i>
<span class="tw-sr-only">{{ "loading" | i18n }}</span>
</div>
}
@if (hasLoaded) {
} @else {
<div class="tw-mt-4">
@if (!ciphers.length) {
<bit-callout type="success" title="{{ 'goodNews' | i18n }}">
{{ "noReusedPasswords" | i18n }}
</bit-callout>
}
@if (ciphers.length) {
} @else {
<bit-callout type="danger" title="{{ 'reusedPasswordsFound' | i18n }}">
{{ "reusedPasswordsFoundReportDesc" | i18n: (ciphers.length | number) : vaultMsg }}
</bit-callout>

View File

@@ -11,15 +11,13 @@
></i>
<span class="tw-sr-only">{{ "loading" | i18n }}</span>
</div>
}
@if (hasLoaded) {
} @else {
<div class="tw-mt-4">
@if (!ciphers.length) {
<bit-callout type="success" title="{{ 'goodNews' | i18n }}">
{{ "noUnsecuredWebsites" | i18n }}
</bit-callout>
}
@if (ciphers.length) {
} @else {
<bit-callout type="danger" title="{{ 'unsecuredWebsitesFound' | i18n }}">
{{ "unsecuredWebsitesFoundReportDesc" | i18n: (ciphers.length | number) : vaultMsg }}
</bit-callout>

View File

@@ -11,15 +11,13 @@
></i>
<span class="tw-sr-only">{{ "loading" | i18n }}</span>
</div>
}
@if (hasLoaded) {
} @else {
<div class="tw-mt-4">
@if (!ciphers.length) {
<bit-callout type="success" title="{{ 'goodNews' | i18n }}">
{{ "noWeakPasswords" | i18n }}
</bit-callout>
}
@if (ciphers.length) {
} @else {
<bit-callout type="danger" title="{{ 'weakPasswordsFound' | i18n }}">
{{ "weakPasswordsFoundReportDesc" | i18n: (ciphers.length | number) : vaultMsg }}
</bit-callout>