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