Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ export function AllRulesDisabledBanner() {

if (isLoading || !rules) return null;

const allRulesDisabled =
rules.length > 0 && rules.every((rule) => !rule.enabled);
const allRulesDisabled = rules.every((rule) => !rule.enabled);
Comment thread
macroscopeapp[bot] marked this conversation as resolved.

if (!allRulesDisabled) return null;

Comment on lines 19 to 24
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropping the rules.length > 0 guard means rules.every((rule) => !rule.enabled) now returns true when the list is empty, so the "All rules are disabled" banner renders for accounts that actually have no rules yet. That makes the copy inaccurate and will confuse users in the empty/onboarding state, whereas prior logic only showed the banner once at least one rule existed and was disabled.

Suggested change
if (isLoading || !rules) return null;
const allRulesDisabled =
rules.length > 0 && rules.every((rule) => !rule.enabled);
const allRulesDisabled = rules.every((rule) => !rule.enabled);
if (!allRulesDisabled) return null;
if (isLoading || !rules) return null;
const allRulesDisabled =
rules.length > 0 && rules.every((rule) => !rule.enabled);
if (!allRulesDisabled) return null;

Finding type: Logical Bugs

Expand Down
Loading