Skip to content

Commit

Permalink
fix creation of layout_opts
Browse files Browse the repository at this point in the history
  • Loading branch information
leafo committed Feb 15, 2023
1 parent e8482f9 commit fef6bcd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lapis/request.lua
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,11 @@ do
end
end
if self.options.layout == nil then
self.layout_opts = { }
self.options.layout = self.app.layout
end
if self.options.layout then
self.layout_opts = { }
end
local widget_cls = self.options.render
if widget_cls == true then
widget_cls = self.route_name
Expand Down
5 changes: 3 additions & 2 deletions lapis/request.moon
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,14 @@ class Request

-- set default layout if none is specified
if @options.layout == nil
@options.layout = @app.layout

if @options.layout
-- NOTE: @layout_opts is a legacy undocumented field, it should be eventually
-- be removed now that @options can communicate the layout being used
-- during view rendering
@layout_opts = {}

@options.layout = @app.layout

widget_cls = @options.render
widget_cls = @route_name if widget_cls == true

Expand Down

0 comments on commit fef6bcd

Please sign in to comment.