From 62df4e2facbb7db197a634405054cf18fddbc10a Mon Sep 17 00:00:00 2001 From: cutls Date: Tue, 8 Sep 2020 18:49:55 +0900 Subject: [PATCH] bug of custom sound --- app/js/ui/settings.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/js/ui/settings.js b/app/js/ui/settings.js index d4d8b271..1c10955f 100644 --- a/app/js/ui/settings.js +++ b/app/js/ui/settings.js @@ -167,10 +167,10 @@ function load() { var font = '' } $('#font').val(font) - $('#c1-file').text(localStorage.getItem('custom1')) - $('#c2-file').text(localStorage.getItem('custom2')) - $('#c3-file').text(localStorage.getItem('custom3')) - $('#c4-file').text(localStorage.getItem('custom4')) + $('#c1-file').text(localStorage.getItem('custom1')!= 'null' ? localStorage.getItem('custom1') : '') + $('#c2-file').text(localStorage.getItem('custom2')!= 'null' ? localStorage.getItem('custom2') : '') + $('#c3-file').text(localStorage.getItem('custom3')!= 'null' ? localStorage.getItem('custom3') : '') + $('#c4-file').text(localStorage.getItem('custom4')!= 'null' ? localStorage.getItem('custom4') : '') var cvol = localStorage.getItem('customVol') if (cvol) { $('#soundvol').val(cvol * 100) @@ -754,7 +754,7 @@ function customSound(key) { } function customSoundSave(key, file) { localStorage.setItem('custom' + key, file) - $('#c1-file').text(file) + $(`#c${key}-file`).text(file) } window.onload = function () { //最初に読む