interface: profiles would intermittently show contact information when they should not, fixes this

This commit is contained in:
Logan Allen 2021-02-12 11:48:50 -06:00
parent 38ac5f191f
commit 1c4baea62f

View File

@ -80,6 +80,7 @@ export function ChatResource(props: ChatResourceProps) {
}, [station]);
const [showBanner, setShowBanner] = useState(false);
const [hasLoadedAllowed, setHasLoadedAllowed] = useState(false);
const [recipients, setRecipients] = useState([]);
const res = resourceFromPath(groupPath);
@ -123,6 +124,8 @@ export function ChatResource(props: ChatResourceProps) {
);
setShowBanner(!groupShared);
}
setHasLoadedAllowed(true);
})();
}, [groupPath]);
@ -151,7 +154,10 @@ export function ChatResource(props: ChatResourceProps) {
history={props.history}
graph={graph}
unreadCount={unreadCount}
contacts={!showBanner ? contacts : modifiedContacts}
contacts={
(!showBanner && hasLoadedAllowed) ?
contacts : modifiedContacts
}
association={props.association}
associations={props.associations}
groups={props.groups}
@ -166,9 +172,13 @@ export function ChatResource(props: ChatResourceProps) {
ref={chatInput}
api={props.api}
station={station}
ourContact={!showBanner ? ourContact : null}
ourContact={
(!showBanner && hasLoadedAllowed) ? ourContact : null
}
envelopes={[]}
contacts={contacts}
contacts={
(!showBanner && hasLoadedAllowed) ? contacts : modifiedContacts
}
onUnmount={appendUnsent}
s3={props.s3}
placeholder="Message..."