Skip to content

Commit

Permalink
try fix #62
Browse files Browse the repository at this point in the history
  • Loading branch information
bates64 committed Apr 28, 2023
1 parent d503934 commit b213f7e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mamar-web/src/app/store/root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,13 @@ export function rootReducer(root: Root, action: RootAction): Root {
activeDocId: action.id,
}
case "open_doc": {
const fileExtension = action.file?.name?.split(".").pop()?.toLowerCase()
const newDoc: Doc = {
id: generateId(),
bgm: action.bgm ?? new_bgm(),
fileHandle: action.file?.handle,
fileHandle: (fileExtension === "bgm") ? action.file?.handle : undefined,
name: action.name || action.file?.name || "New song",
isSaved: true,
isSaved: fileExtension === "bgm", // Prompt to save if not a BGM file (i.e. opened a MIDI)
activeVariation: 0,
panelContent: {
type: "not_open",
Expand Down

0 comments on commit b213f7e

Please sign in to comment.