From 9a8ce706273c92d572961b63b047939a4789d0a8 Mon Sep 17 00:00:00 2001 From: Shaban Kamel Date: Thu, 5 Sep 2024 23:39:15 +0300 Subject: [PATCH] Solara --- solara/lib/core/dashboard/handler/edit_section_handler.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/solara/lib/core/dashboard/handler/edit_section_handler.rb b/solara/lib/core/dashboard/handler/edit_section_handler.rb index 6de5e68..62ffaf8 100644 --- a/solara/lib/core/dashboard/handler/edit_section_handler.rb +++ b/solara/lib/core/dashboard/handler/edit_section_handler.rb @@ -10,7 +10,6 @@ def mount key = request_payload['key'] data = request_payload['data'] - update_section(key, data, brand_key) set_current_brand_content_changed(brand_key, true) @@ -33,7 +32,7 @@ def update_section(key, data, brand_key) path = template[:path] if File.exist?(path) - if path.include?('theme.json') + if key == 'theme' update_theme(path, data) else File.write(path, JSON.pretty_generate(data)) @@ -47,7 +46,6 @@ def update_section(key, data, brand_key) raise end - # TODO: This workround should be improved def update_theme(path, data) json = JSON.parse(File.read(path)) json['colors'] = data