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

Commit

Permalink
Merge pull request #123 from latitudegames/bug-fixes
Browse files Browse the repository at this point in the history
Bug fixes
  • Loading branch information
parzival418 authored Oct 14, 2021
2 parents 695a6c8 + aa09f4c commit 00dbe91
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 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
3 changes: 2 additions & 1 deletion client/src/features/Thoth/components/DataControls/Input.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ const Input = ({ control, updateData, initialValue }) => {

const onChange = e => {
setValue(e.target.value)
const value = e.target.value === '\\n' ? '\n' : e.target.value
updateData({
[dataKey]: e.target.value,
[dataKey]: value,
})
}

Expand Down
15 changes: 5 additions & 10 deletions core/src/components/StringProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Rete from 'rete'

import { NodeData, ThothNode, ThothWorkerInputs } from '../../types'
import { CodeControl } from '../dataControls/CodeControl'
import { OutputGeneratorControl } from '../dataControls/OutputGenerator'
import { SocketGeneratorControl } from '../dataControls/SocketGenerator'
import { stringSocket, triggerSocket } from '../sockets'
import { ThothComponent } from '../thoth-component'
const info = `The String Processor component take s astring as an input and allows you to write a function in the text editor to parse that string in whatever way you need. You can define any number of outputs which you can pass the result of your parsing out through.
Expand Down Expand Up @@ -36,16 +36,11 @@ export class StringProcessor extends ThothComponent {
const triggerOut = new Rete.Output('trigger', 'Trigger', triggerSocket)

// Inspector controls
const outputGenerator = new OutputGeneratorControl({
const outputGenerator = new SocketGeneratorControl({
socketType: 'stringSocket',
taskType: 'output',
ignored: [
{
name: 'trigger',
socketType: 'triggerSocket',
taskType: 'option',
},
],
connectionType: 'output',
ignored: ['trigger'],
name: 'Output Sockets',
})

const codeControl = new CodeControl({
Expand Down

0 comments on commit 00dbe91

Please sign in to comment.