fixed channel host missing icon

This commit is contained in:
Roland Osborne 2022-04-25 23:01:16 -07:00
parent a5af21fefb
commit 77bbb4cadc
2 changed files with 10 additions and 22 deletions

View File

@ -13,15 +13,7 @@ export function useChannelLabel() {
const profile = useContext(ProfileContext); const profile = useContext(ProfileContext);
const actions = { const actions = {
getCardByGuid: (guid) => { getCardByGuid: card.actions.getCardByGuid,
let c = null;
card.state.cards.forEach((value, key, map) => {
if(value?.data?.cardProfile?.guid == guid) {
c = value;
}
});
return c;
},
}; };
const updateState = (value) => { const updateState = (value) => {
@ -29,8 +21,10 @@ export function useChannelLabel() {
} }
useEffect(() => { useEffect(() => {
if (card.state.init && profile.state.init) {
updateState({ guid: profile.state.profile.guid }); updateState({ guid: profile.state.profile.guid });
}, [profile]) }
}, [card, profile])
return { state, actions }; return { state, actions };
} }

View File

@ -13,15 +13,7 @@ export function useChannelLogo() {
const actions = { const actions = {
getCardImageUrl: card.actions.getImageUrl, getCardImageUrl: card.actions.getImageUrl,
getCardByGuid: (guid) => { getCardByGuid: card.actions.getCardByGuid,
let c = null;
card.state.cards.forEach((value, key, map) => {
if(value?.data?.cardProfile?.guid == guid) {
c = value;
}
});
return c;
},
}; };
const updateState = (value) => { const updateState = (value) => {
@ -29,8 +21,10 @@ export function useChannelLogo() {
} }
useEffect(() => { useEffect(() => {
if (card.state.init && profile.state.init) {
updateState({ guid: profile.state.profile.guid }) updateState({ guid: profile.state.profile.guid })
}, [profile]) }
}, [card, profile])
return { state, actions }; return { state, actions };
} }