diff --git a/neode-ui/src/views/Federation.vue b/neode-ui/src/views/Federation.vue index dc01c548..9fc43ddd 100644 --- a/neode-ui/src/views/Federation.vue +++ b/neode-ui/src/views/Federation.vue @@ -190,7 +190,8 @@ :dwn-syncing="dwnSyncing" :deploying="deploying" :deploy-result="deployResult" - @close="selectedNode = null" + :action-error="nodeActionError" + @close="selectedNode = null; nodeActionError = ''" @change-trust="changeTrust" @remove-node="removeNode" @deploy-app="deployApp" @@ -272,6 +273,9 @@ const nodesRes = useCachedResource({ const nodes = computed(() => nodesRes.data.value ?? []) const loading = computed(() => nodesRes.loadState.value === 'loading') const error = ref('') +/** Failure from an action taken inside NodeDetailModal (trust dropdown). Kept + * separate from `error`, which renders in NodeList behind the modal. */ +const nodeActionError = ref('') const selectedNode = ref(null) const inviteType = ref<'trusted' | 'observer'>('trusted') @@ -656,6 +660,7 @@ async function requestTrustChange(did: string, level: string, password?: string) } async function changeTrust(did: string, level: string) { + nodeActionError.value = '' try { await requestTrustChange(did, level) } catch (e) { @@ -667,7 +672,12 @@ async function changeTrust(did: string, level: string) { ) return } - error.value = e instanceof Error ? e.message : 'Failed to update trust level' + // Show the failure INSIDE the open modal. `error` renders in NodeList, + // which sits behind NodeDetailModal — so routing it there made a failed + // trust change look like the dropdown simply doing nothing. + const msg = e instanceof Error ? e.message : 'Failed to update trust level' + if (selectedNode.value?.did === did) nodeActionError.value = msg + else error.value = msg } } diff --git a/neode-ui/src/views/federation/NodeDetailModal.vue b/neode-ui/src/views/federation/NodeDetailModal.vue index 1fd7ded7..9c91f665 100644 --- a/neode-ui/src/views/federation/NodeDetailModal.vue +++ b/neode-ui/src/views/federation/NodeDetailModal.vue @@ -37,6 +37,7 @@

Granted via: {{ trustSourceLabel }}

+

Added

@@ -146,6 +147,11 @@ const props = defineProps<{ dwnSyncing: boolean deploying: boolean deployResult: string + /** Failure from an action taken INSIDE this modal (e.g. the trust dropdown). + * Federation.vue used to route these to the page-level banner in NodeList, + * which sits behind this modal — so a failed trust change looked like + * nothing happening at all. */ + actionError?: string }>() const emit = defineEmits<{