#1022 solved bug doesent overiding old data in localstorage if users had ben using the old version of this component

This commit is contained in:
Gerard 2019-01-25 09:05:57 +01:00
parent f4839cb642
commit e55bcaecfd
1 changed files with 8 additions and 2 deletions

View File

@ -78,11 +78,17 @@ class Controller {
getUserConfig() {
this.$http.get('/api/UserConfigs/getUserConfig')
.then(res => {
if (res.data && res.data.warehouseFk)
if (res.data && res.data.warehouseFk) {
this.warehouse = res.data.warehouseFk;
if (!window.localStorage.defaultWarehouseFk || window.localStorage.defaultWarehouseFk === 'null')
window.localStorage.defaultWarehouseFk = res.data.warehouseFk;
}
if (res.data && res.data.companyFk)
if (res.data && res.data.companyFk) {
this.company = res.data.companyFk;
if (!window.localStorage.defaultCompanyFk || window.localStorage.defaultCompanyFk === 'null')
window.localStorage.defaultCompanyFk = res.data.companyFk;
}
});
}