From aba4ddf2db3139f1dd580f2363f22b82af472c1c Mon Sep 17 00:00:00 2001 From: dank074 Date: Wed, 1 Feb 2023 14:22:39 -0600 Subject: [PATCH] only update playlist editor when open --- .../widgets/furniture/useFurniturePlaylistEditorWidget.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hooks/rooms/widgets/furniture/useFurniturePlaylistEditorWidget.ts b/src/hooks/rooms/widgets/furniture/useFurniturePlaylistEditorWidget.ts index cdb41ddc..05607f0d 100644 --- a/src/hooks/rooms/widgets/furniture/useFurniturePlaylistEditorWidget.ts +++ b/src/hooks/rooms/widgets/furniture/useFurniturePlaylistEditorWidget.ts @@ -81,8 +81,10 @@ const useFurniturePlaylistEditorWidgetState = () => simpleAlert(LocalizeText('playlist.editor.alert.playlist.full'), NotificationAlertType.ALERT, '', '', LocalizeText('playlist.editor.alert.playlist.full.title')); }); - const onFurniListUpdated = useCallback((event : IMessageEvent) => + const onFurniListUpdated = (event : IMessageEvent) => { + if(objectId === -1) return; + if(event instanceof FurnitureListEvent) { if(event.getParser().fragmentNumber === 0) @@ -94,7 +96,7 @@ const useFurniturePlaylistEditorWidgetState = () => { GetNitroInstance().soundManager.musicController?.requestUserSongDisks(); } - }, []); + } useMessageEvent(FurnitureListEvent, onFurniListUpdated); useMessageEvent(FurnitureListRemovedEvent, onFurniListUpdated);