Add conditional for preload functions

This commit is contained in:
jeffvli 2022-12-25 01:25:46 -08:00
parent 4614358163
commit 1fbdfe725c
9 changed files with 13 additions and 10 deletions

View file

@ -2,7 +2,7 @@ import { useEffect } from 'react';
import isElectron from 'is-electron';
import { useMuted, usePlayerControls, useVolume } from '/@/renderer/store';
const mpvPlayer = window.electron.mpvPlayer;
const mpvPlayer = isElectron() ? window.electron.mpvPlayer : null;
export const useRightControls = () => {
const { setVolume, setMuted } = usePlayerControls();