Fix wait for prefs on default channel set
This commit is contained in:
parent
1dccc1ac64
commit
11bdb6a872
1 changed files with 7 additions and 3 deletions
|
@ -160,7 +160,6 @@ function App(props: Props) {
|
||||||
const hasMyChannels = myChannelClaimIds && myChannelClaimIds.length > 0;
|
const hasMyChannels = myChannelClaimIds && myChannelClaimIds.length > 0;
|
||||||
const hasNoChannels = myChannelClaimIds && myChannelClaimIds.length === 0;
|
const hasNoChannels = myChannelClaimIds && myChannelClaimIds.length === 0;
|
||||||
const shouldMigrateLanguage = LANGUAGE_MIGRATIONS[language];
|
const shouldMigrateLanguage = LANGUAGE_MIGRATIONS[language];
|
||||||
const hasActiveChannelClaim = activeChannelClaim !== undefined;
|
|
||||||
const renderFiledrop = !isMobile && isAuthenticated;
|
const renderFiledrop = !isMobile && isAuthenticated;
|
||||||
const connectionStatus = useConnectionStatus();
|
const connectionStatus = useConnectionStatus();
|
||||||
|
|
||||||
|
@ -343,10 +342,15 @@ function App(props: Props) {
|
||||||
if (hasMyChannels) {
|
if (hasMyChannels) {
|
||||||
fetchModBlockedList();
|
fetchModBlockedList();
|
||||||
fetchModAmIList();
|
fetchModAmIList();
|
||||||
if (activeChannelClaim && !defaultChannelClaim) doSetDefaultChannel(activeChannelClaim.claim_id);
|
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [hasMyChannels, hasNoChannels, hasActiveChannelClaim, setIncognito]);
|
}, [hasMyChannels, hasNoChannels, setIncognito]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (hasMyChannels && activeChannelClaim && !defaultChannelClaim && prefsReady) {
|
||||||
|
doSetDefaultChannel(activeChannelClaim.claim_id);
|
||||||
|
}
|
||||||
|
}, [activeChannelClaim, defaultChannelClaim, doSetDefaultChannel, hasMyChannels, prefsReady]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// $FlowFixMe
|
// $FlowFixMe
|
||||||
|
|
Loading…
Reference in a new issue