mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 03:29:16 +00:00
fix error on logout
This commit is contained in:
parent
3276764f70
commit
68d22fd69f
@ -27,10 +27,8 @@ export function Cards({ showRegistry }) {
|
||||
if (actions?.getCardImageUrl) {
|
||||
return actions.getCardImageUrl(item.id, item.revision);
|
||||
}
|
||||
else {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<CardsWrapper>
|
||||
|
@ -13,6 +13,13 @@ export function Registry() {
|
||||
actions.select(item);
|
||||
};
|
||||
|
||||
const registryImage = (item) => {
|
||||
if (actions?.getRegistryImageUrl) {
|
||||
return actions.getRegistryImageUrl(item.guid, item.revision);
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<RegistryWrapper>
|
||||
<Input.Search placeholder="Server" value={state.server} onChange={(e) => actions.setServer(e.target.Value)}
|
||||
@ -27,7 +34,7 @@ export function Registry() {
|
||||
<RegistryItem onClick={() => onSelect(item)}>
|
||||
<div class="item">
|
||||
<div class="logo">
|
||||
<Logo imageUrl={actions.getRegistryImageUrl(item.guid, item.revision)}
|
||||
<Logo imageUrl={registryImage(item)}
|
||||
imageSet={item.imageSet} />
|
||||
</div>
|
||||
<div class="username">
|
||||
|
@ -41,7 +41,12 @@ export function useRegistry() {
|
||||
updateState({ busy: false });
|
||||
}
|
||||
},
|
||||
getRegistryImageUrl: (guid, revision) => app.actions.getRegistryImageUrl(state.server, guid, revision),
|
||||
getRegistryImageUrl: (guid, revision) => {
|
||||
if (app?.actions?.getRegistryImageUrl) {
|
||||
return app.actions.getRegistryImageUrl(state.server, guid, revision);
|
||||
}
|
||||
return null;
|
||||
},
|
||||
select: (contact) => {
|
||||
navigate(`/user/contact/${contact.guid}`, { state: contact });
|
||||
}
|
||||
@ -50,5 +55,3 @@ export function useRegistry() {
|
||||
return { state, actions };
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user