Merge pull request #1799 from vinodkiran/BUGFIX/dashboard-view-toggle

Bugfix: View Toggle loses state when button is clicked twice.
This commit is contained in:
Vinod Paidimarry 2024-02-22 20:17:11 -08:00 committed by GitHub
commit 39f6991b0f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 0 deletions

View File

@ -47,6 +47,7 @@ const Chatflows = () => {
const [view, setView] = React.useState(localStorage.getItem('flowDisplayStyle') || 'card') const [view, setView] = React.useState(localStorage.getItem('flowDisplayStyle') || 'card')
const handleChange = (event, nextView) => { const handleChange = (event, nextView) => {
if (nextView === null) return
localStorage.setItem('flowDisplayStyle', nextView) localStorage.setItem('flowDisplayStyle', nextView)
setView(nextView) setView(nextView)
} }

View File

@ -131,6 +131,7 @@ const Marketplace = () => {
} }
const handleViewChange = (event, nextView) => { const handleViewChange = (event, nextView) => {
if (nextView === null) return
localStorage.setItem('mpDisplayStyle', nextView) localStorage.setItem('mpDisplayStyle', nextView)
setView(nextView) setView(nextView)
} }