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:
@@ -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);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
export function shouldExposeAccountNsfwSettings(nodeIsNsfw: boolean): boolean {
|
||||
return !nodeIsNsfw;
|
||||
}
|
||||
Reference in New Issue
Block a user