Handle invalidated application keys after auth failures
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user