Skip to content

Commit

Permalink
fix: use assetUrl for hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinslin committed Sep 10, 2021
1 parent 51cf963 commit a0a16d6
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions packages/nextjs-template/utils/hooks.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
import {
FuseEngine,
getStage,
NoteProps,
NotePropsDict,
} from "@dendronhq/common-all";
import { FuseEngine, NoteProps, NotePropsDict } from "@dendronhq/common-all";
import { verifyEngineSliceState } from "@dendronhq/common-frontend";
import _ from "lodash";
import { useRouter } from "next/router";
import React from "react";
import { verifyEngineSliceState } from "@dendronhq/common-frontend";
import { useEngineAppSelector } from "../features/engine/hooks";
import { getNoteRouterQuery } from "./etc";
import { NoteData } from "./types";
import { fetchNotes } from "./fetchers";

export type DendronRouterProps = ReturnType<typeof useDendronRouter>;
export type DendronLookupProps = ReturnType<typeof useDendronLookup>;
Expand Down Expand Up @@ -59,8 +54,8 @@ export function useDendronLookup() {
const [noteIndex, setNoteIndex] =
React.useState<FuseEngine | undefined>(undefined);
React.useEffect(() => {
fetch("/data/notes.json").then(async (resp) => {
const { notes } = (await resp.json()) as NoteData;
fetchNotes().then(async (noteData) => {
const { notes } = noteData;
const noteIndex = new FuseEngine({ mode: "fuzzy" });
noteIndex.updateNotesIndex(notes);
setNoteIndex(noteIndex);
Expand Down

0 comments on commit a0a16d6

Please sign in to comment.