Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

Commit

Permalink
Use save spell rather than new spell on import
Browse files Browse the repository at this point in the history
  • Loading branch information
parzival418 committed Oct 13, 2021
1 parent 695a6c8 commit e607a3d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client/src/features/StartScreen/StartScreen.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState } from 'react'
import { useLocation } from 'wouter'

import { useNewSpellMutation, useGetSpellsQuery } from '../../state/spells'
import { useSaveSpellMutation, useGetSpellsQuery } from '../../state/spells'
import { useDB } from '../../contexts/DatabaseProvider'
import { useTabManager } from '../../contexts/TabManagerProvider'
import AllProjects from './components/AllProjects'
Expand All @@ -16,7 +16,7 @@ const StartScreen = ({ createNew, allProjects }) => {
const { openTab } = useTabManager()
const [, setLocation] = useLocation()

const [newSpell] = useNewSpellMutation()
const [saveSpell] = useSaveSpellMutation()
const { data: spells } = useGetSpellsQuery()

const onReaderLoad = async event => {
Expand All @@ -26,7 +26,7 @@ const StartScreen = ({ createNew, allProjects }) => {
try {
spell = await models.spells.getSpell(spellData.name)
} catch (error) {
spell = await newSpell(spellData)
spell = await saveSpell(spellData)
}
// Load modules from the spell
if (spellData?.modules && spellData.modules.length > 0)
Expand Down

0 comments on commit e607a3d

Please sign in to comment.