Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't show track view if there is only one track #1209

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion editor-settings.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@

[trackSelection]

# If the track selection appears in the main menu
# If the track selection appears in the main menu.
# Note: The track selection will never appear if there is only one track.
# Type: boolean
# Default: true
#show = true
Expand Down
6 changes: 4 additions & 2 deletions src/main/MainMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { setPageNumber } from "../redux/finishSlice";
import { MainMenuStateNames } from "../types";
import { settings } from "../config";
import { basicButtonStyle, flexGapReplacementStyle } from "../cssStyles";
import { setIsPlaying } from "../redux/videoSlice";
import { selectVideoCount, setIsPlaying } from "../redux/videoSlice";

import { useTranslation } from "react-i18next";
import { resetPostRequestState as metadataResetPostRequestState } from "../redux/metadataSlice";
Expand All @@ -31,6 +31,8 @@ const MainMenu: React.FC = () => {
const { t } = useTranslation();
const theme = useTheme();

const videoCount = useAppSelector(selectVideoCount);

const mainMenuStyle = css({
borderRight: `${theme.menuBorder}`,
minWidth: "120px",
Expand Down Expand Up @@ -59,7 +61,7 @@ const MainMenu: React.FC = () => {
bottomText={t(MainMenuStateNames.metadata)}
ariaLabelText={t(MainMenuStateNames.metadata)}
/>}
{settings.trackSelection.show && <MainMenuButton
{settings.trackSelection.show && videoCount > 1 && <MainMenuButton
Icon={LuFilm}
stateName={MainMenuStateNames.trackSelection}
bottomText={t(MainMenuStateNames.trackSelection)}
Expand Down
Loading