Fix wrong world substitution
This commit is contained in:
parent
479ebbf9b9
commit
6b9a5ee2fa
|
|
@ -47,6 +47,7 @@ const RenameInput = ({ value, onSubmit, onCancel, className }: RenameInputProps)
|
||||||
|
|
||||||
interface StoryItemProps {
|
interface StoryItemProps {
|
||||||
story: Story;
|
story: Story;
|
||||||
|
world: World;
|
||||||
active: boolean;
|
active: boolean;
|
||||||
onSelect: () => void;
|
onSelect: () => void;
|
||||||
onRename: (newTitle: string) => void;
|
onRename: (newTitle: string) => void;
|
||||||
|
|
@ -55,7 +56,7 @@ interface StoryItemProps {
|
||||||
onExport: () => void;
|
onExport: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const StoryItem = ({ story, active, onSelect, onRename, onDelete, onDuplicate, onExport }: StoryItemProps) => {
|
const StoryItem = ({ story, world, active, onSelect, onRename, onDelete, onDuplicate, onExport }: StoryItemProps) => {
|
||||||
const isEditing = useBool(false);
|
const isEditing = useBool(false);
|
||||||
const appState = useAppState();
|
const appState = useAppState();
|
||||||
|
|
||||||
|
|
@ -78,7 +79,10 @@ const StoryItem = ({ story, active, onSelect, onRename, onDelete, onDuplicate, o
|
||||||
onClick={onSelect}
|
onClick={onSelect}
|
||||||
onDblClick={isEditing.setTrue}
|
onDblClick={isEditing.setTrue}
|
||||||
>
|
>
|
||||||
{Prompt.substituteVars(appState, story.title)}
|
{Prompt.substituteVars({
|
||||||
|
...appState,
|
||||||
|
currentWorld: world,
|
||||||
|
}, story.title)}
|
||||||
</button>
|
</button>
|
||||||
<div class={styles.actions}>
|
<div class={styles.actions}>
|
||||||
<button class={styles.actionButton} onClick={isEditing.setTrue} title="Rename">
|
<button class={styles.actionButton} onClick={isEditing.setTrue} title="Rename">
|
||||||
|
|
@ -179,6 +183,7 @@ const WorldItem = ({
|
||||||
{world.stories.map(story => (
|
{world.stories.map(story => (
|
||||||
<StoryItem
|
<StoryItem
|
||||||
key={story.id}
|
key={story.id}
|
||||||
|
world={world}
|
||||||
story={story}
|
story={story}
|
||||||
active={activeStoryId === story.id && activeWorldId === world.id}
|
active={activeStoryId === story.id && activeWorldId === world.id}
|
||||||
onSelect={() => onSelectStory(story.id)}
|
onSelect={() => onSelectStory(story.id)}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue