From 362a88b6bcd09a8294fc05a9070259f841916938 Mon Sep 17 00:00:00 2001 From: Kendall Garner <17521368+kgarner7@users.noreply.github.com> Date: Wed, 24 Jan 2024 21:15:11 -0800 Subject: [PATCH] [bugfix]: fix race condition for opening play queue/playlist details --- src/renderer/features/now-playing/components/play-queue.tsx | 2 +- .../playlists/components/playlist-detail-song-list-content.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer/features/now-playing/components/play-queue.tsx b/src/renderer/features/now-playing/components/play-queue.tsx index 98a8516b6..0b8bc5815 100644 --- a/src/renderer/features/now-playing/components/play-queue.tsx +++ b/src/renderer/features/now-playing/components/play-queue.tsx @@ -173,7 +173,7 @@ export const PlayQueue = forwardRef(({ type }: QueueProps, ref: Ref) => { const handleGridSizeChange = () => { if (tableConfig.autoFit) { - tableRef?.current?.api.sizeColumnsToFit(); + tableRef?.current?.api?.sizeColumnsToFit(); } }; diff --git a/src/renderer/features/playlists/components/playlist-detail-song-list-content.tsx b/src/renderer/features/playlists/components/playlist-detail-song-list-content.tsx index dc4063525..298e47429 100644 --- a/src/renderer/features/playlists/components/playlist-detail-song-list-content.tsx +++ b/src/renderer/features/playlists/components/playlist-detail-song-list-content.tsx @@ -140,7 +140,7 @@ export const PlaylistDetailSongListContent = ({ tableRef }: PlaylistDetailConten const handleGridSizeChange = () => { if (page.table.autoFit) { - tableRef?.current?.api.sizeColumnsToFit(); + tableRef?.current?.api?.sizeColumnsToFit(); } };