If color is not known then do not check a color. Allows user to keep color by tapping back button. Also corrects bug with case of color string comparison.
This commit is contained in:
parent
7e2f57d74a
commit
cf5e185f2c
1 changed files with 2 additions and 5 deletions
|
|
@ -37,10 +37,7 @@ angular.module('copayApp.controllers').controller('preferencesColorController',
|
||||||
|
|
||||||
function setCurrentColorIndex() {
|
function setCurrentColorIndex() {
|
||||||
try {
|
try {
|
||||||
$scope.currentColorIndex = colorToIndex(config.colorFor[walletId]);
|
$scope.currentColorIndex = colorToIndex(config.colorFor[walletId] || getColorDefault());
|
||||||
if ($scope.currentColorIndex == undefined) {
|
|
||||||
$scope.currentColorIndex = colorToIndex(getColorDefault());
|
|
||||||
}
|
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
// Wait for DOM to render and try again.
|
// Wait for DOM to render and try again.
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
|
|
@ -54,7 +51,7 @@ angular.module('copayApp.controllers').controller('preferencesColorController',
|
||||||
|
|
||||||
function colorToIndex(color) {
|
function colorToIndex(color) {
|
||||||
for (var i = 0; i < $scope.colorCount; i++) {
|
for (var i = 0; i < $scope.colorCount; i++) {
|
||||||
if (indexToColor(i) == color) {
|
if (indexToColor(i) == color.toLowerCase()) {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue