Adds track title to page title
This commit is contained in:
parent
9274420674
commit
7ca0edff38
@ -1,4 +1,4 @@
|
||||
import {useState} from "react";
|
||||
import {useEffect, useState} from "react";
|
||||
import hostName from "../Config.ts";
|
||||
import {AlbumInfo} from "../models/AlbumInfo.ts";
|
||||
import AlbumInfoDisplay from "./AlbumInfoDisplay.tsx";
|
||||
@ -17,6 +17,11 @@ export default function AlbumPlayer(props: Readonly<AlbumPlayerProps>) {
|
||||
const [isShowAlbumInfo, setIsShowAlbumInfo] = useState(false)
|
||||
|
||||
let album = props.albumInfo
|
||||
|
||||
useEffect(() => {
|
||||
document.title = `Pretty Player - ${album.trackList[trackNum].trackTitle}`; // Quick solution
|
||||
}, [trackNum]);
|
||||
|
||||
function handleNextTrack() {
|
||||
if(!isAlbumOver && trackNum+1 === props.albumInfo.trackList.length) {
|
||||
setIsAlbumOver(true)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user