Hide redundant account NSFW controls on NSFW nodes

Hop-State: A_06FP9K52MYKP328EHYDE018
Hop-Proposal: R_06FP9K42QBKY7ZFP7NX001R
Hop-Task: T_06FP9JMAC3NYKCMJFBPQSM0
Hop-Attempt: AT_06FP9JMAC20R8XKDE9B6M7R
This commit is contained in:
2026-07-15 01:02:40 -07:00
committed by Hop
parent f435e62220
commit be3425994f
4 changed files with 74 additions and 16 deletions
+12
View File
@@ -0,0 +1,12 @@
import { describe, expect, it } from 'vitest';
import { shouldExposeAccountNsfwSettings } from './settings-visibility';
describe('shouldExposeAccountNsfwSettings', () => {
it('hides account NSFW controls when the node is already NSFW', () => {
expect(shouldExposeAccountNsfwSettings(true)).toBe(false);
});
it('keeps account NSFW controls available on general-purpose nodes', () => {
expect(shouldExposeAccountNsfwSettings(false)).toBe(true);
});
});
+3
View File
@@ -0,0 +1,3 @@
export function shouldExposeAccountNsfwSettings(nodeIsNsfw: boolean): boolean {
return !nodeIsNsfw;
}