Make relationship ui state update faster

This commit is contained in:
Lim Chee Aun 2023-09-16 09:43:26 +08:00
parent ad831fae35
commit 679fba4f66

View file

@ -564,6 +564,8 @@ function RelatedActions({ info, instance, authenticated, standalone }) {
try {
const relationships = await fetchRelationships;
console.log('fetched relationship', relationships);
setRelationshipUIState('default');
if (relationships.length) {
const relationship = relationships[0];
setRelationship(relationship);
@ -625,7 +627,6 @@ function RelatedActions({ info, instance, authenticated, standalone }) {
}
}
}
setRelationshipUIState('default');
} catch (e) {
console.error(e);
setRelationshipUIState('error');