Skip to content

Commit

Permalink
Fix bug where NoStorySelected never renders (#303)
Browse files Browse the repository at this point in the history
# Problem

When no story is selected we used to have a message displayed

# Solution

Simply changed where NoStorySelected is rendered. Works now!

Resolves #302 

# Checklist

- [x] Ran `lune run test` locally before merging
  • Loading branch information
vocksel authored Dec 9, 2024
1 parent 364dea3 commit 211b4cf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/Navigation/Screen.luau
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ local Storyteller = require("@pkg/Storyteller")

local AboutView = require("@root/About/AboutView")
local NavigationContext = require("@root/Navigation/NavigationContext")
local NoStorySelected = require("@root/Storybook/NoStorySelected")
local SettingsView = require("@root/UserSettings/SettingsView")
local StoryCanvas = require("@root/Storybook/StoryCanvas")

Expand All @@ -30,6 +31,8 @@ local function Screen(props: Props)
story = props.story,
storybook = props.storybook,
})
else
return React.createElement(NoStorySelected)
end
elseif currentScreen == "Settings" then
return React.createElement(SettingsView)
Expand Down
3 changes: 0 additions & 3 deletions src/Storybook/StoryCanvas.luau
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ local ModuleLoader = require("@pkg/ModuleLoader")
local React = require("@pkg/React")
local Storyteller = require("@pkg/Storyteller")

local NoStorySelected = require("@root/Storybook/NoStorySelected")
local StoryView = require("@root/Storybook/StoryView")
local useTheme = require("@root/Common/useTheme")

Expand Down Expand Up @@ -48,8 +47,6 @@ local function Canvas(props: Props)
story = props.story,
storybook = props.storybook,
}),

NoStorySelected = not props.story and e(NoStorySelected),
}),
})
end
Expand Down

0 comments on commit 211b4cf

Please sign in to comment.