Got my hands to this file and moved $ fun coutside. ...What I was thinking back then?...

This commit is contained in:
Alexander Andreev 2021-09-08 17:21:46 +04:00
parent 17fbfe997f
commit 906968b06c
Signed by: Arav
GPG Key ID: 610DF2574456329F

View File

@ -1,6 +1,6 @@
function updateRadioStatus() { function $(id) { return document.getElementById(id); }
const $ = id => document.getElementById(id);
function updateRadioStatus() {
fetch("/stats") fetch("/stats")
.then(r => r.json()) .then(r => r.json())
.then(radio => { .then(radio => {
@ -18,8 +18,6 @@ function updateRadioStatus() {
} }
function updateLastPlayedSong() { function updateLastPlayedSong() {
const $ = id => document.getElementById(id);
fetch('/lastsong') fetch('/lastsong')
.then(r => r.json()) .then(r => r.json())
.then(last_played => { .then(last_played => {