Fix remove theater mode localstorage flag
This commit is contained in:
parent
d19190bf6a
commit
28f2fbd6a7
@ -126,7 +126,6 @@ const VideoPlayer = ({
|
|||||||
const [searchParams] = useSearchParams();
|
const [searchParams] = useSearchParams();
|
||||||
const searchParamVideoProgress = searchParams.get('t');
|
const searchParamVideoProgress = searchParams.get('t');
|
||||||
|
|
||||||
const theaterModeFromStorage = localStorage.getItem('theaterMode') === 'true';
|
|
||||||
const volumeFromStorage = Number(localStorage.getItem('playerVolume') ?? 1);
|
const volumeFromStorage = Number(localStorage.getItem('playerVolume') ?? 1);
|
||||||
const playBackSpeedFromStorage = Number(localStorage.getItem('playerSpeed') || 1);
|
const playBackSpeedFromStorage = Number(localStorage.getItem('playerSpeed') || 1);
|
||||||
const playBackSpeedIndex =
|
const playBackSpeedIndex =
|
||||||
@ -141,7 +140,7 @@ const VideoPlayer = ({
|
|||||||
const [showHelpDialog, setShowHelpDialog] = useState(false);
|
const [showHelpDialog, setShowHelpDialog] = useState(false);
|
||||||
const [showInfoDialog, setShowInfoDialog] = useState(false);
|
const [showInfoDialog, setShowInfoDialog] = useState(false);
|
||||||
const [infoDialogContent, setInfoDialogContent] = useState('');
|
const [infoDialogContent, setInfoDialogContent] = useState('');
|
||||||
const [isTheaterMode, setIsTheaterMode] = useState(theaterModeFromStorage);
|
const [isTheaterMode, setIsTheaterMode] = useState(false);
|
||||||
const [theaterModeKeyPressed, setTheaterModeKeyPressed] = useState(false);
|
const [theaterModeKeyPressed, setTheaterModeKeyPressed] = useState(false);
|
||||||
|
|
||||||
const questionmarkPressed = useKeyPress('?');
|
const questionmarkPressed = useKeyPress('?');
|
||||||
@ -361,8 +360,6 @@ const VideoPlayer = ({
|
|||||||
const newTheaterMode = !isTheaterMode;
|
const newTheaterMode = !isTheaterMode;
|
||||||
setIsTheaterMode(newTheaterMode);
|
setIsTheaterMode(newTheaterMode);
|
||||||
|
|
||||||
localStorage.setItem('theaterMode', newTheaterMode.toString());
|
|
||||||
|
|
||||||
infoDialog(newTheaterMode ? 'Theater mode' : 'Normal mode');
|
infoDialog(newTheaterMode ? 'Theater mode' : 'Normal mode');
|
||||||
} else if (!theaterModePressed) {
|
} else if (!theaterModePressed) {
|
||||||
setTheaterModeKeyPressed(false);
|
setTheaterModeKeyPressed(false);
|
||||||
@ -377,8 +374,6 @@ const VideoPlayer = ({
|
|||||||
if (escapePressed && isTheaterMode) {
|
if (escapePressed && isTheaterMode) {
|
||||||
setIsTheaterMode(false);
|
setIsTheaterMode(false);
|
||||||
|
|
||||||
localStorage.setItem('theaterMode', 'false');
|
|
||||||
|
|
||||||
infoDialog('Normal mode');
|
infoDialog('Normal mode');
|
||||||
}
|
}
|
||||||
}, [escapePressed, isTheaterMode]);
|
}, [escapePressed, isTheaterMode]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user