a tool for shared writing and social publishing
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

don't do contenteditable shenanigans on desktop

+5 -2
+5 -2
components/Blocks.tsx
··· 20 20 import { useUIState } from "src/useUIState"; 21 21 import { focusCard } from "./Cards"; 22 22 import { CardBlock } from "./CardBlock"; 23 + import { useIsMobile } from "src/hooks/isMobile"; 23 24 24 25 export type Block = { 25 26 position: string; ··· 32 33 export function Blocks(props: { entityID: string }) { 33 34 let rep = useReplicache(); 34 35 let ref = useRef<HTMLDivElement | null>(null); 35 - let previous = useRef("none"); 36 + let previous = useRef("None"); 37 + let isMobile = useIsMobile(); 36 38 useEffect(() => { 39 + if (!isMobile) return; 37 40 let selectionChangeHandler = () => { 38 41 let selection = window.getSelection(); 39 42 let ranges; ··· 90 93 document.removeEventListener("keydown", keyDownHandler, true); 91 94 document.removeEventListener("selectionchange", selectionChangeHandler); 92 95 }; 93 - }, []); 96 + }, [isMobile]); 94 97 let initialValue = useMemo( 95 98 () => 96 99 rep.initialFacts