Skip to content

Commit 27aed1c

Browse files
Move isMacos to a module-level constant
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8319617 commit 27aed1c

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

app/src/app.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type CSSProperties, useState } from "react";
1+
import type { CSSProperties } from "react";
22

33
import { useTheme } from "@/shared/hooks/use-theme";
44
import { Bar, Container, Section } from "@column-resizer/react";
@@ -20,9 +20,10 @@ import { useRevealMainWindow } from "@/features/shell/use-reveal-main-window";
2020
import { useShellController } from "@/features/shell/use-shell-controller";
2121
import { useUIStore } from "@/features/settings/store/use-ui-store";
2222

23+
const IS_MACOS = navigator.userAgent.includes("Mac");
24+
2325
function App() {
2426
useTheme();
25-
const [isMacos] = useState(() => navigator.userAgent.includes("Mac"));
2627
const {
2728
bootstrapError,
2829
chooseConflictDialogProps,
@@ -60,12 +61,12 @@ function App() {
6061
className="text-foreground relative h-full min-h-0 overflow-hidden"
6162
style={
6263
{
63-
"--titlebar-height": isMacos ? "3.25rem" : "0px",
64+
"--titlebar-height": IS_MACOS ? "3.25rem" : "0px",
6465
} as CSSProperties
6566
}
6667
>
6768
<div className="relative h-full min-h-0">
68-
{isMacos ? (
69+
{IS_MACOS ? (
6970
<div
7071
className="absolute inset-x-0 top-0 z-30 h-(--titlebar-height)"
7172
data-tauri-drag-region

0 commit comments

Comments
 (0)