diff --git a/src/common/utils/composable-responsibilities/showable/showable.ts b/src/common/utils/composable-responsibilities/showable/showable.ts index ab59288e40..c6d3ef90d1 100644 --- a/src/common/utils/composable-responsibilities/showable/showable.ts +++ b/src/common/utils/composable-responsibilities/showable/showable.ts @@ -14,7 +14,11 @@ export interface Showable< isShown?: T; } -export const isShown = (showable: Showable) => { +export const isShown = (showable: Showable | {}) => { + if (!("isShown" in showable)) { + return true; + } + if (showable.isShown === undefined) { return true; } diff --git a/src/features/preferences/renderer/preference-items/preference-tab-root.tsx b/src/features/preferences/renderer/preference-items/preference-tab-root.tsx index 41d2687402..6a21fa320a 100644 --- a/src/features/preferences/renderer/preference-items/preference-tab-root.tsx +++ b/src/features/preferences/renderer/preference-items/preference-tab-root.tsx @@ -6,20 +6,17 @@ import React from "react"; import { HorizontalLine } from "../../../../renderer/components/horizontal-line/horizontal-line"; import type { RootComposite } from "../../../../common/utils/composite/interfaces"; import type { Discriminable } from "../../../../common/utils/composable-responsibilities/discriminable/discriminable"; -import type { Showable } from "../../../../common/utils/composable-responsibilities/showable/showable"; import type { ChildrenAreSeparated } from "./preference-item-injection-token"; export type PreferenceTabsRoot = & Discriminable<"preference-tabs-root"> & RootComposite - & ChildrenAreSeparated - & Showable; + & ChildrenAreSeparated; export const preferenceTabsRoot: PreferenceTabsRoot = { kind: "preference-tabs-root" as const, id: "preference-tabs", parentId: undefined, - isShown: true as const, childSeparator: () => (