From 3fb50b30f7386781f7d7fd7f947801686dd6cceb Mon Sep 17 00:00:00 2001 From: "plebeius.eth" Date: Sat, 16 Sep 2023 10:36:27 +0200 Subject: [PATCH] fix state of admin board settings --- src/components/BoardSettings.jsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/BoardSettings.jsx b/src/components/BoardSettings.jsx index 811d360c..846d9cff 100644 --- a/src/components/BoardSettings.jsx +++ b/src/components/BoardSettings.jsx @@ -262,6 +262,12 @@ const BoardSettings = ({ subplebbit }) => { const handleCloseModal = () => { setIsModalOpen(false); + setBoardSettingsJson(JSON.stringify(initialSettings, null, 2)); + }; + + const openModal = () => { + setIsModalOpen(true); + setBoardSettingsJson(JSON.stringify(generateSettingsFromSubplebbit(subplebbit), null, 2)); }; @@ -309,7 +315,7 @@ const BoardSettings = ({ subplebbit }) => { { window.electron && window.electron.isElectron - ? setIsModalOpen(true) + ? openModal() : alert( 'To edit this board you must be using the plebchan desktop app, which is a plebbit full node that seeds the board automatically.\n\nDownload plebchan here:\n\nhttps://github.com/plebbit/plebchan/releases/latest' );