mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 03:29:16 +00:00
fixed channel host missing icon
This commit is contained in:
parent
a5af21fefb
commit
77bbb4cadc
@ -13,15 +13,7 @@ export function useChannelLabel() {
|
||||
const profile = useContext(ProfileContext);
|
||||
|
||||
const actions = {
|
||||
getCardByGuid: (guid) => {
|
||||
let c = null;
|
||||
card.state.cards.forEach((value, key, map) => {
|
||||
if(value?.data?.cardProfile?.guid == guid) {
|
||||
c = value;
|
||||
}
|
||||
});
|
||||
return c;
|
||||
},
|
||||
getCardByGuid: card.actions.getCardByGuid,
|
||||
};
|
||||
|
||||
const updateState = (value) => {
|
||||
@ -29,8 +21,10 @@ export function useChannelLabel() {
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
updateState({ guid: profile.state.profile.guid });
|
||||
}, [profile])
|
||||
if (card.state.init && profile.state.init) {
|
||||
updateState({ guid: profile.state.profile.guid });
|
||||
}
|
||||
}, [card, profile])
|
||||
|
||||
return { state, actions };
|
||||
}
|
||||
|
@ -13,15 +13,7 @@ export function useChannelLogo() {
|
||||
|
||||
const actions = {
|
||||
getCardImageUrl: card.actions.getImageUrl,
|
||||
getCardByGuid: (guid) => {
|
||||
let c = null;
|
||||
card.state.cards.forEach((value, key, map) => {
|
||||
if(value?.data?.cardProfile?.guid == guid) {
|
||||
c = value;
|
||||
}
|
||||
});
|
||||
return c;
|
||||
},
|
||||
getCardByGuid: card.actions.getCardByGuid,
|
||||
};
|
||||
|
||||
const updateState = (value) => {
|
||||
@ -29,8 +21,10 @@ export function useChannelLogo() {
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
updateState({ guid: profile.state.profile.guid })
|
||||
}, [profile])
|
||||
if (card.state.init && profile.state.init) {
|
||||
updateState({ guid: profile.state.profile.guid })
|
||||
}
|
||||
}, [card, profile])
|
||||
|
||||
return { state, actions };
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user