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,6 +2,7 @@ import type { MutableRefObject } from 'react';
import type { AgGridReact as AgGridReactType } from '@ag-grid-community/react/lib/agGridReact';
import { Group } from '@mantine/core';
import { Button, Popover, TableConfigDropdown } from '/@/renderer/components';
import isElectron from 'is-electron';
import {
RiArrowDownLine,
RiArrowUpLine,
@ -14,7 +15,7 @@ import { Song } from '/@/renderer/api/types';
import { useQueueControls } from '/@/renderer/store';
import { TableType } from '/@/renderer/types';
const mpvPlayer = window.electron.mpvPlayer;
const mpvPlayer = isElectron() ? window.electron.mpvPlayer : null;
interface PlayQueueListOptionsProps {
tableRef: MutableRefObject<{ grid: AgGridReactType<Song> } | null>;

View file

@ -27,13 +27,14 @@ import {
useTableSettings,
} from '/@/renderer/store/settings.store';
import { useMergedRef } from '@mantine/hooks';
import isElectron from 'is-electron';
import { ErrorBoundary } from 'react-error-boundary';
import { VirtualTable } from '/@/renderer/components/virtual-table';
import { ErrorFallback } from '/@/renderer/features/action-required';
import { TableType } from '/@/renderer/types';
import { QueueSong } from '/@/renderer/api/types';
const mpvPlayer = window.electron.mpvPlayer;
const mpvPlayer = isElectron() ? window.electron.mpvPlayer : null;
type QueueProps = {
type: TableType;