Extract out WELCOME_TEXT
This commit is contained in:
parent
ceebc2edb4
commit
0614fa1460
1 changed files with 3 additions and 2 deletions
|
|
@ -52,11 +52,12 @@ function navidromeURL(path: string, params: Record<string, string>): string {
|
||||||
}).toString();
|
}).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const WELCOME_TEXT = "Scan an album to begin.";
|
||||||
function App() {
|
function App() {
|
||||||
const [album, setAlbum] = useState<AlbumType | null>(null);
|
const [album, setAlbum] = useState<AlbumType | null>(null);
|
||||||
const [buffer, setBuffer] = useState<string[]>([]);
|
const [buffer, setBuffer] = useState<string[]>([]);
|
||||||
const [nowPlaying, play] = useState<number>(0);
|
const [nowPlaying, play] = useState<number>(0);
|
||||||
const [displayText, setDisplayText] = useState("Scan an album to begin.");
|
const [displayText, setDisplayText] = useState(WELCOME_TEXT);
|
||||||
const [paused, setPaused] = useState(true);
|
const [paused, setPaused] = useState(true);
|
||||||
const [currentTime, setCurrentTime] = useState(0);
|
const [currentTime, setCurrentTime] = useState(0);
|
||||||
const [duration, setDuration] = useState(0);
|
const [duration, setDuration] = useState(0);
|
||||||
|
|
@ -146,7 +147,7 @@ function App() {
|
||||||
});
|
});
|
||||||
if (searchResponse.count === 0) {
|
if (searchResponse.count === 0) {
|
||||||
setDisplayText("No album found for barcode: " + barcode);
|
setDisplayText("No album found for barcode: " + barcode);
|
||||||
setTimeout(() => setDisplayText("Scan an album to begin."), 3000);
|
setTimeout(() => setDisplayText(WELCOME_TEXT), 3000);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
mbRelease = searchResponse.releases[0];
|
mbRelease = searchResponse.releases[0];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue