fix(post form): opening settings would close post form

This commit is contained in:
Tom (plebeius.eth)
2024-08-06 22:34:27 +02:00
parent a39262865d
commit 17f57a1d7d
+4 -2
View File
@@ -33,8 +33,10 @@ const BoardLayout = () => {
return <NotFound />;
}
// force rerender of post form when navigating between pages
const key = `${subplebbitAddress}-${location.pathname}`;
// force rerender of post form when navigating between pages, except when opening settings modal in current view
const key = location.pathname.endsWith('/settings')
? `${subplebbitAddress}-${location.pathname.replace(/\/settings$/, '')}`
: `${subplebbitAddress}-${location.pathname}`;
return (
<div className={styles.boardLayout}>