Bugfix: View Toggle loses state when button is clicked twice.

This commit is contained in:
vinodkiran
2024-02-23 07:07:46 +05:30
parent c31b1c356f
commit 0a5195d1ab
2 changed files with 3 additions and 0 deletions
+2
View File
@@ -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)
}
@@ -131,6 +131,7 @@ const Marketplace = () => {
}
const handleViewChange = (event, nextView) => {
if (nextView === null) return
localStorage.setItem('mpDisplayStyle', nextView)
setView(nextView)
}