Skip to content

Commit 68d75af

Browse files
committed
async import simfile parser
1 parent dc6280f commit 68d75af

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/drop-handler.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
Switch,
88
} from "@blueprintjs/core";
99
import { useCallback, useEffect, useMemo, useState } from "react";
10-
import { PackWithSongs, parsePack } from "simfile-parser/browser";
10+
import type { PackWithSongs } from "simfile-parser/browser";
1111
import { useDrawState } from "./draw-state";
1212
import { getDataFileFromPack } from "./utils/itg-import";
1313
import { pause } from "./utils/pause";
@@ -81,7 +81,8 @@ function useDataParsing(
8181
setParsedPack(null);
8282
return;
8383
}
84-
parsePack(droppedFolder)
84+
import("simfile-parser/browser")
85+
.then(({ parsePack }) => parsePack(droppedFolder))
8586
.then((pack) => {
8687
setParsedPack(pack);
8788
if (

src/utils/itg-import.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { PackWithSongs } from "simfile-parser/browser";
1+
import type { PackWithSongs } from "simfile-parser/browser";
22
import { GameData, Chart, Song } from "../models/SongData";
33

44
export function getDataFileFromPack(

0 commit comments

Comments
 (0)