Skip to content

Commit

Permalink
Remove debug prints
Browse files Browse the repository at this point in the history
  • Loading branch information
vocksel committed Nov 9, 2024
1 parent 8a43b16 commit dee5ca2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
4 changes: 0 additions & 4 deletions src/Storybook/StoryPreview.luau
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,10 @@ local StoryPreview = React.forwardRef(function(providedProps: Props, ref: any)

React.useEffect(function()
if props.story == prevStory and props.controls ~= prevControls then
print("story or controls changed")
local areControlsDifferent = prevControls and not Sift.Dictionary.equals(props.controls, prevControls)

if lifecycle.current and areControlsDifferent then
local success, result = xpcall(function()
print("update", props.controls)
lifecycle.current.update(props.controls)
end, debug.traceback)

Expand All @@ -63,7 +61,6 @@ local StoryPreview = React.forwardRef(function(providedProps: Props, ref: any)
if props.story and ref.current then
-- TODO: Rendering before controls are applied
local success, result = xpcall(function()
print("render")
lifecycle.current = Storyteller.render(ref.current, props.story)
end, debug.traceback)

Expand All @@ -74,7 +71,6 @@ local StoryPreview = React.forwardRef(function(providedProps: Props, ref: any)

return function()
if lifecycle.current then
print("unmount")
lifecycle.current.unmount()
lifecycle.current = nil
end
Expand Down
6 changes: 0 additions & 6 deletions src/Storybook/StoryView.luau
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ local function StoryView(props: Props)
local theme = useTheme()
local settingsContext = SettingsContext.use()
local story, storyErr = Storyteller.useStory(props.story, props.storybook, props.loader)
local prevStory = usePrevious(story)
local zoom = useZoom(props.story)
local plugin = React.useContext(PluginContext.Context)
local changedControls, setChangedControls = React.useState({})
Expand All @@ -44,7 +43,6 @@ local function StoryView(props: Props)
local storyParentRef = React.useRef(nil :: GuiObject?)

React.useEffect(function()
print("setChangedControls({})")
setChangedControls({})
end, { story })

Expand All @@ -64,13 +62,9 @@ local function StoryView(props: Props)
return controls
end, { story, changedControls } :: { unknown })

print("changedControls", changedControls)
print("controlsWithUserOverrides", controlsWithUserOverrides)

local showControls = controlsWithUserOverrides and not Sift.isEmpty(controlsWithUserOverrides)

local setControl = React.useCallback(function(control: string, newValue: any)
print("setControl", control, newValue)
setChangedControls(function(prev)
return Sift.Dictionary.merge(prev, {
[control] = newValue,
Expand Down

0 comments on commit dee5ca2

Please sign in to comment.