Handle invalidated application keys after auth failures

This commit is contained in:
2026-04-06 18:31:31 +02:00
parent 35c30120b8
commit 34664be951
7 changed files with 103 additions and 0 deletions
+7
View File
@@ -515,6 +515,9 @@ export function labelCreatePageData(store) {
...loadLabelDraft(),
},
async init() {
if (!store.isConnected) {
return;
}
await this.loadLocations();
this.$watch('form', () => this.persistDraft(), { deep: true });
this.$watch('form.stockType', (value) => {
@@ -536,6 +539,10 @@ export function labelCreatePageData(store) {
}, 250);
},
async loadLocations() {
if (!store.isConnected) {
return;
}
try {
const { flat } = await fetchLocations(store);
this.locations = flat;
+4
View File
@@ -152,6 +152,10 @@ export function stockDetailPageData(store) {
level: 'plenty',
},
async init() {
if (!store.isConnected) {
return;
}
const { params } = getRouteContext();
await runAsyncState(this.state, async () => {
this.entry = await getStockEntry(store, params.id);
+11
View File
@@ -442,9 +442,16 @@ export function stockListPageData(store) {
location: '',
},
async init() {
if (!store.isConnected) {
return;
}
await Promise.all([this.loadLocations(), this.loadEntries()]);
},
async loadEntries() {
if (!store.isConnected) {
return;
}
await runAsyncState(this.state, async () => {
const loadedEntries = await listStockEntries(store);
this.entries = sortEntries(loadedEntries);
@@ -461,6 +468,10 @@ export function stockListPageData(store) {
}).catch(() => {});
},
async loadLocations() {
if (!store.isConnected) {
return;
}
try {
const { flat } = await fetchLocations(store);
this.locations = flat;