Skip to content

Commit

Permalink
fix: 修复设置页面没成功初始化设置问题
Browse files Browse the repository at this point in the history
  • Loading branch information
hanxi committed Jul 5, 2024
1 parent c75230a commit 4c17614
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions xiaomusic/static/setting.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,16 @@ $(function(){

// 初始化显示
for (const key in data) {
if (data.hasOwnProperty(key) && data[key] != "") {
if (data.hasOwnProperty(key)) {
const $element = $("#" + key);
if ($element.length) {
$element.val(data[key]);
if (data[key] === true) {
$element.val('true');
} else if (data[key] === false) {
$element.val('false');
} else {
$element.val(data[key]);
}
}
}
}
Expand Down

0 comments on commit 4c17614

Please sign in to comment.