From 4d127a038bf768eded68aae3cfa5c1b12241bdac Mon Sep 17 00:00:00 2001 From: Maze Winther Date: Fri, 27 Mar 2026 00:55:15 +0100 Subject: chore: normalize line endings --- apps/web/src/hooks/use-menu-preview.ts | 52 +++++++++++++++++----------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'apps/web/src/hooks/use-menu-preview.ts') diff --git a/apps/web/src/hooks/use-menu-preview.ts b/apps/web/src/hooks/use-menu-preview.ts index a17ee278..a3c14489 100644 --- a/apps/web/src/hooks/use-menu-preview.ts +++ b/apps/web/src/hooks/use-menu-preview.ts @@ -1,26 +1,26 @@ -import { useRef } from "react"; -import { useEditor } from "@/hooks/use-editor"; - -export function useMenuPreview() { - const editor = useEditor(); - const didCommitRef = useRef(false); - - const discard = () => { - if (!didCommitRef.current && editor.timeline.isPreviewActive()) { - editor.timeline.discardPreview(); - } - }; - - const markCommitted = () => { - didCommitRef.current = true; - }; - - const onOpenChange = (isOpen: boolean) => { - if (!isOpen) { - discard(); - didCommitRef.current = false; - } - }; - - return { onPointerLeave: discard, onOpenChange, markCommitted }; -} +import { useRef } from "react"; +import { useEditor } from "@/hooks/use-editor"; + +export function useMenuPreview() { + const editor = useEditor(); + const didCommitRef = useRef(false); + + const discard = () => { + if (!didCommitRef.current && editor.timeline.isPreviewActive()) { + editor.timeline.discardPreview(); + } + }; + + const markCommitted = () => { + didCommitRef.current = true; + }; + + const onOpenChange = (isOpen: boolean) => { + if (!isOpen) { + discard(); + didCommitRef.current = false; + } + }; + + return { onPointerLeave: discard, onOpenChange, markCommitted }; +} -- cgit v1.3.1