Skip to content

Commit

Permalink
fix(search): fix cannot select auto lyric mode
Browse files Browse the repository at this point in the history
- resolve #1125
  • Loading branch information
Su-Yong committed Oct 23, 2024
1 parent 4eeaec7 commit bd50958
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion common/schema/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export const LyricMapperModeSchema = z.union([
LyricMapperModeProviderSchema,
]);
export const LyricMapperSchema = z.record(z.object({
mode: LyricMapperModeSchema.optional(),
mode: LyricMapperModeSchema.optional().nullable(),
delay: z.number().optional(),
}).optional());

Expand Down
2 changes: 1 addition & 1 deletion renderer/components/PlayingInfoProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const PlayingInfoProvider = (props: { children: JSX.Element }) => {

const mode = mapper[id()]?.mode;

if (mode === undefined) return 'auto';
if (!mode) return 'auto';
if (mode.type === 'none') return 'none';
if (mode.type === 'player') return 'player';

Expand Down
2 changes: 1 addition & 1 deletion renderer/lyrics/SideBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const SideBar = () => {
});

const onChangeLyricMode = (mode: LyricMode) => {
let newMode: LyricMapperMode | undefined = undefined;
let newMode: LyricMapperMode | null = null;
if (mode === 'player') newMode = { type: 'player' };
if (mode === 'none') newMode = { type: 'none' };

Expand Down

0 comments on commit bd50958

Please sign in to comment.