From 0a5195d1abbaf563c6de1a5f0cb95a13b164c3ed Mon Sep 17 00:00:00 2001 From: vinodkiran Date: Fri, 23 Feb 2024 07:07:46 +0530 Subject: [PATCH 1/2] Bugfix: View Toggle loses state when button is clicked twice. --- packages/ui/src/views/chatflows/index.js | 2 ++ packages/ui/src/views/marketplaces/index.js | 1 + 2 files changed, 3 insertions(+) diff --git a/packages/ui/src/views/chatflows/index.js b/packages/ui/src/views/chatflows/index.js index c87ad306..c1e9ade4 100644 --- a/packages/ui/src/views/chatflows/index.js +++ b/packages/ui/src/views/chatflows/index.js @@ -47,6 +47,8 @@ const Chatflows = () => { const [view, setView] = React.useState(localStorage.getItem('flowDisplayStyle') || 'card') const handleChange = (event, nextView) => { + if (nextView === null) return + console.log('nextView == ' + nextView) localStorage.setItem('flowDisplayStyle', nextView) setView(nextView) } diff --git a/packages/ui/src/views/marketplaces/index.js b/packages/ui/src/views/marketplaces/index.js index e5a65cb9..a6d29e43 100644 --- a/packages/ui/src/views/marketplaces/index.js +++ b/packages/ui/src/views/marketplaces/index.js @@ -131,6 +131,7 @@ const Marketplace = () => { } const handleViewChange = (event, nextView) => { + if (nextView === null) return localStorage.setItem('mpDisplayStyle', nextView) setView(nextView) } From f690943316f175f80f9ee0fdf602ba27c64e3c1b Mon Sep 17 00:00:00 2001 From: vinodkiran Date: Fri, 23 Feb 2024 07:19:26 +0530 Subject: [PATCH 2/2] Bugfix: lint fixes (no-console) --- packages/ui/src/views/chatflows/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/ui/src/views/chatflows/index.js b/packages/ui/src/views/chatflows/index.js index c1e9ade4..6426cdd6 100644 --- a/packages/ui/src/views/chatflows/index.js +++ b/packages/ui/src/views/chatflows/index.js @@ -48,7 +48,6 @@ const Chatflows = () => { const handleChange = (event, nextView) => { if (nextView === null) return - console.log('nextView == ' + nextView) localStorage.setItem('flowDisplayStyle', nextView) setView(nextView) }