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 {
|
||||
story: Story;
|
||||
world: World;
|
||||
active: boolean;
|
||||
onSelect: () => void;
|
||||
onRename: (newTitle: string) => void;
|
||||
|
|
@ -55,7 +56,7 @@ interface StoryItemProps {
|
|||
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 appState = useAppState();
|
||||
|
||||
|
|
@ -78,7 +79,10 @@ const StoryItem = ({ story, active, onSelect, onRename, onDelete, onDuplicate, o
|
|||
onClick={onSelect}
|
||||
onDblClick={isEditing.setTrue}
|
||||
>
|
||||
{Prompt.substituteVars(appState, story.title)}
|
||||
{Prompt.substituteVars({
|
||||
...appState,
|
||||
currentWorld: world,
|
||||
}, story.title)}
|
||||
</button>
|
||||
<div class={styles.actions}>
|
||||
<button class={styles.actionButton} onClick={isEditing.setTrue} title="Rename">
|
||||
|
|
@ -179,6 +183,7 @@ const WorldItem = ({
|
|||
{world.stories.map(story => (
|
||||
<StoryItem
|
||||
key={story.id}
|
||||
world={world}
|
||||
story={story}
|
||||
active={activeStoryId === story.id && activeWorldId === world.id}
|
||||
onSelect={() => onSelectStory(story.id)}
|
||||
|
|
|
|||
Loading…
Reference in New Issue