From 02baf3607080b1c7b98c368f117fc9759182cf3e Mon Sep 17 00:00:00 2001 From: Noelia Date: Fri, 9 Jun 2023 11:54:47 +0200 Subject: [PATCH] fix(warnings): Fixed qml warnings Fixed qml warnings --- .../Wallet/controls/NetworkFilter.qml | 3 +- ui/imports/utils/Utils.qml | 60 ++++++++++--------- 2 files changed, 33 insertions(+), 30 deletions(-) diff --git a/ui/app/AppLayouts/Wallet/controls/NetworkFilter.qml b/ui/app/AppLayouts/Wallet/controls/NetworkFilter.qml index 924411d49c..f32ff9b147 100644 --- a/ui/app/AppLayouts/Wallet/controls/NetworkFilter.qml +++ b/ui/app/AppLayouts/Wallet/controls/NetworkFilter.qml @@ -31,7 +31,8 @@ StatusComboBox { property string selectedChainName: "" property string selectedIconUrl: "" - readonly property bool allSelected: root.enabledNetworks.count === root.allNetworks.count + readonly property bool allSelected: (!!root.enabledNetworks && !!root.allNetworks) ? root.enabledNetworks.count === root.allNetworks.count : + false // Persist selection between selectPopupLoader reloads property var currentModel: layer1Networks diff --git a/ui/imports/utils/Utils.qml b/ui/imports/utils/Utils.qml index c54512a5fa..6fc729fde1 100644 --- a/ui/imports/utils/Utils.qml +++ b/ui/imports/utils/Utils.qml @@ -765,35 +765,37 @@ QtObject { } function getColorForId(colorId) { - switch(colorId.toUpperCase()) { - case Constants.walletAccountColors.primary.toUpperCase(): - return Theme.palette.customisationColors.blue - case Constants.walletAccountColors.purple.toUpperCase(): - return Theme.palette.customisationColors.purple - case Constants.walletAccountColors.orange.toUpperCase(): - return Theme.palette.customisationColors.orange - case Constants.walletAccountColors.army.toUpperCase(): - return Theme.palette.customisationColors.army - case Constants.walletAccountColors.turquoise.toUpperCase(): - return Theme.palette.customisationColors.turquoise - case Constants.walletAccountColors.sky.toUpperCase(): - return Theme.palette.customisationColors.sky - case Constants.walletAccountColors.yellow.toUpperCase(): - return Theme.palette.customisationColors.yellow - case Constants.walletAccountColors.pink.toUpperCase(): - return Theme.palette.customisationColors.pink - case Constants.walletAccountColors.copper.toUpperCase(): - return Theme.palette.customisationColors.copper - case Constants.walletAccountColors.camel.toUpperCase(): - return Theme.palette.customisationColors.camel - case Constants.walletAccountColors.magenta.toUpperCase(): - return Theme.palette.customisationColors.magenta - case Constants.walletAccountColors.yinYang.toUpperCase(): - return Theme.palette.customisationColors.yinYang - case Constants.walletAccountColors.undefinedAccount.toUpperCase(): - return Theme.palette.baseColor1 - default: - return Theme.palette.customisationColors.blue + if(colorId) { + switch(colorId.toUpperCase()) { + case Constants.walletAccountColors.primary.toUpperCase(): + return Theme.palette.customisationColors.blue + case Constants.walletAccountColors.purple.toUpperCase(): + return Theme.palette.customisationColors.purple + case Constants.walletAccountColors.orange.toUpperCase(): + return Theme.palette.customisationColors.orange + case Constants.walletAccountColors.army.toUpperCase(): + return Theme.palette.customisationColors.army + case Constants.walletAccountColors.turquoise.toUpperCase(): + return Theme.palette.customisationColors.turquoise + case Constants.walletAccountColors.sky.toUpperCase(): + return Theme.palette.customisationColors.sky + case Constants.walletAccountColors.yellow.toUpperCase(): + return Theme.palette.customisationColors.yellow + case Constants.walletAccountColors.pink.toUpperCase(): + return Theme.palette.customisationColors.pink + case Constants.walletAccountColors.copper.toUpperCase(): + return Theme.palette.customisationColors.copper + case Constants.walletAccountColors.camel.toUpperCase(): + return Theme.palette.customisationColors.camel + case Constants.walletAccountColors.magenta.toUpperCase(): + return Theme.palette.customisationColors.magenta + case Constants.walletAccountColors.yinYang.toUpperCase(): + return Theme.palette.customisationColors.yinYang + case Constants.walletAccountColors.undefinedAccount.toUpperCase(): + return Theme.palette.baseColor1 + default: + return Theme.palette.customisationColors.blue + } } }