Skip to content

Commit 2b01bf8

Browse files
committed
fix(setting): returning wrong value in events
1 parent 26603eb commit 2b01bf8

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/utils/settings/RegisteredSetting.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ export default class RegisteredSetting {
162162
if (typeof this.#onChange === 'function') {
163163
this.#onChange(this.value, prev);
164164
}
165-
this.#events.emit(key, val, prev);
166-
this.#events.emit('setting:change', key, val, prev);
165+
this.#events.emit(key, this.value, prev);
166+
this.#events.emit('setting:change', key, this.value, prev);
167167
}
168168

169169
set value(val) {
@@ -172,7 +172,7 @@ export default class RegisteredSetting {
172172

173173
get value() {
174174
const val = localStorage.getItem(this.key);
175-
if (!val) {
175+
if (val === null) {
176176
return this.default;
177177
}
178178
return this.type.value(val, this.data);
@@ -206,7 +206,6 @@ export default class RegisteredSetting {
206206
if (typeof input === 'function') {
207207
return input();
208208
}
209-
210209
return input;
211210
}
212211
}

0 commit comments

Comments
 (0)