From 1f6e57d9113497fd05f0eb31685319f9062ab11d Mon Sep 17 00:00:00 2001 From: zeppi Date: Sat, 29 Jan 2022 17:19:24 -0500 Subject: [PATCH] fix anon collection publishing --- ui/component/collectionEdit/view.jsx | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/ui/component/collectionEdit/view.jsx b/ui/component/collectionEdit/view.jsx index 54d125068..b2a08976e 100644 --- a/ui/component/collectionEdit/view.jsx +++ b/ui/component/collectionEdit/view.jsx @@ -273,12 +273,18 @@ function CollectionForm(props: Props) { // on mount, if we get a collectionChannel, set it. React.useEffect(() => { - if (hasClaim && !initialized) { - if (collectionChannel) { - setActiveChannel(collectionChannel); - setIncognito(false); - } else if (!collectionChannel && hasClaim) { - setIncognito(true); + if (!initialized) { + if (hasClaim) { + if (collectionChannel) { + setActiveChannel(collectionChannel); + setIncognito(false); + } else if (!collectionChannel && hasClaim) { + setIncognito(true); + } + } else { + if (incognito) { + setIncognito(true); + } } setInitialized(true); } @@ -287,9 +293,10 @@ function CollectionForm(props: Props) { // every time activechannel or incognito changes, set it. React.useEffect(() => { if (initialized) { - if (activeChannelId) { + if (activeChannelId && !incognito) { setParam({ channel_id: activeChannelId }); - } else if (incognito) { + } + if (incognito) { setParam({ channel_id: undefined }); } }