Skip to content

Commit bc236be

Browse files
committed
fix: list value of 0 falling back to label
1 parent b2a9626 commit bc236be

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# UnderScript Changelog
22

3+
## Version 0.50.1 (2022-03-28)
4+
1. Fixed boolean setting errors
5+
1. Fixed board background setting not applying your background
6+
1. NOTE: If you changed this setting, Legend is now at the bottom of your list due to a bug.
7+
38
## Version 0.50.0 (2022-03-28)
49
### New Features
510
1. Colorized cards in deck storage

src/utils/settings/list.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ export default class List extends ArraySetting {
55
super(name);
66
}
77

8+
value(val, data = []) {
9+
// TODO: convert to data mapping
10+
return super.value(val);
11+
}
12+
813
default(data = []) {
914
return data.map(getValue);
1015
}
@@ -88,7 +93,9 @@ export default class List extends ArraySetting {
8893

8994
function getValue(item) {
9095
if (typeof item === 'object') {
91-
return item.val || item.value || getLabel(item); // Fallback to label should technically be an invalid state... but whatever
96+
if (item.val !== undefined) return item.val;
97+
if (item.value !== undefined) return item.value;
98+
return getLabel(item); // Fallback to label should technically be an invalid state... but whatever
9299
}
93100
return item;
94101
}

0 commit comments

Comments
 (0)