fix(ui): distinguish loading, failed and empty lists, one role label set, en dash for no value

This commit is contained in:
sam committed 2026-10-18 15:54:31 +11:00
1 parent ac60445bf8
commit aae8dafdd7
16 files changed
+95 -46

No files matched your search

+7
View File
@@ -58,6 +58,9 @@ export const useOrgStore = defineStore("org", () => {
}
const identities = ref<Identity[]>([]);
/** True once the first identity read settled, so a list can wait without
* showing its empty state. */
const identitiesLoaded = ref(false);
const identityError = ref("");
const identityBusy = ref("");
const session = useSessionStore();
@@ -74,6 +77,8 @@ export const useOrgStore = defineStore("org", () => {
identityError.value = "";
} catch (cause) {
identityError.value = message(cause);
} finally {
identitiesLoaded.value = true;
}
}
/** watchIdentities reads the list once and then follows the live stream. */
@@ -83,6 +88,7 @@ export const useOrgStore = defineStore("org", () => {
stop = session.subscribe("identities", (data) => {
identities.value = (data as { identities: Identity[] }).identities;
identityError.value = "";
identitiesLoaded.value = true;
});
}
async function mutate(key: string, action: () => Promise<unknown>): Promise<boolean> {
@@ -116,6 +122,7 @@ export const useOrgStore = defineStore("org", () => {
loadOrg,
viewOrg,
identities,
identitiesLoaded,
activeIdentities,
identityName,
identityError,