mirror of https://github.com/rancher/dashboard.git
Fix following review
- if we have the brand and that brand value is not what we want it to be... set it - if we use brandSetting?.value a falsy brandSetting would result in the code below triggering
This commit is contained in:
parent
3b4fa5176a
commit
c16c746fa8
|
|
@ -117,11 +117,9 @@ export default {
|
|||
return;
|
||||
}
|
||||
|
||||
// The brand setting will only get updated if
|
||||
// 1) There should be a brand... but there's no brand setting
|
||||
// 2) There should not be a brand... but there is a brand setting
|
||||
|
||||
// The brand setting will only get updated if...
|
||||
if (neu && !this.brand) {
|
||||
// 1) There should be a brand... but there's no brand setting
|
||||
const brandSetting = findBy(this.globalSettings, 'id', SETTING.BRAND);
|
||||
|
||||
if (brandSetting) {
|
||||
|
|
@ -140,7 +138,8 @@ export default {
|
|||
} else if (!neu) {
|
||||
const brandSetting = findBy(this.globalSettings, 'id', SETTING.BRAND);
|
||||
|
||||
if (brandSetting.value !== '') {
|
||||
if (brandSetting && brandSetting.value !== '') {
|
||||
// 2) There should not be a brand... but there is a brand setting
|
||||
brandSetting.value = '';
|
||||
brandSetting.save();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue