refactor: Replace the useSubtypes selection hook with a generic useSubtype hook

This commit is contained in:
Daniel J. Geiger 2023-09-23 15:54:27 -05:00
parent ec26aeead2
commit ef0fcc1537
4 changed files with 22 additions and 67 deletions

View file

@ -5,7 +5,7 @@ import { trackEvent } from "../src/analytics";
import { getDefaultAppState } from "../src/appState";
import { ErrorDialog } from "../src/components/ErrorDialog";
import { TopErrorBoundary } from "../src/components/TopErrorBoundary";
import { useSubtypes } from "../src/element/subtypes/use";
import { useMathSubtype } from "../src/element/subtypes/mathjax";
import {
APP_NAME,
EVENT,
@ -304,7 +304,7 @@ const ExcalidrawWrapper = () => {
const [excalidrawAPI, excalidrawRefCallback] =
useCallbackRefState<ExcalidrawImperativeAPI>();
useSubtypes(excalidrawAPI);
useMathSubtype(excalidrawAPI);
const [collabAPI] = useAtom(collabAPIAtom);
const [, setCollabDialogShown] = useAtom(collabDialogShownAtom);