fix(ui): distinguish loading, failed and empty lists, one role label set, en dash for no value
This commit is contained in:
16 files changed
+95
-46
No files matched your search
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user