fix: avoid duplicate PDA warehouse profile requests
This commit is contained in:
@@ -57,7 +57,11 @@
|
||||
return '晚上好'
|
||||
}
|
||||
},
|
||||
onShow() { if (!requireSession()) return; this.user = session.currentUser; this.loadWarehouseProfile() },
|
||||
onShow() {
|
||||
if (!requireSession()) return
|
||||
this.user = session.currentUser
|
||||
if (!this.user?.warehouseCode || !this.user?.warehouseName) this.loadWarehouseProfile()
|
||||
},
|
||||
onBackPress() {
|
||||
if (!this.menuOpen) return false
|
||||
this.$refs.portalHeader.closeMenu()
|
||||
|
||||
@@ -145,3 +145,8 @@ test('Chinese English and Spanish locale selection is persisted from profile wit
|
||||
assert.match(profile, /uni\.showActionSheet[\s\S]*setLocale\(selected\.value\)/)
|
||||
assert.match(inbound, /warehouse-profile/)
|
||||
})
|
||||
|
||||
test('home reuses the persisted warehouse profile instead of requesting it on every show', async () => {
|
||||
const home = await read('../src/pages/home/home.vue')
|
||||
assert.match(home, /if \(!this\.user\?\.warehouseCode \|\| !this\.user\?\.warehouseName\) this\.loadWarehouseProfile\(\)/)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user