From 1107328443b5e0bc29a43ebf2ee01d50d38656bf Mon Sep 17 00:00:00 2001 From: Kristina Date: Wed, 9 Oct 2024 08:46:31 +0400 Subject: [PATCH] Fix video autoclose (#6843) Signed-off-by: Kristina Fefelova --- .../src/components/chat/navigator/NavItem.svelte | 2 +- .../love-resources/src/components/ControlExt.svelte | 11 ++++++++--- .../src/components/NotifyMarker.svelte | 12 +++++++++++- .../src/components/sidebar/widgets/WidgetsBar.svelte | 2 +- plugins/workbench-resources/src/sidebar.ts | 12 ++++++++++-- 5 files changed, 31 insertions(+), 8 deletions(-) diff --git a/plugins/chunter-resources/src/components/chat/navigator/NavItem.svelte b/plugins/chunter-resources/src/components/chat/navigator/NavItem.svelte index 19189fc5e6..aba8a60fec 100644 --- a/plugins/chunter-resources/src/components/chat/navigator/NavItem.svelte +++ b/plugins/chunter-resources/src/components/chat/navigator/NavItem.svelte @@ -102,7 +102,7 @@
{:else if secondaryNotifyMarker}
- +
{/if} diff --git a/plugins/love-resources/src/components/ControlExt.svelte b/plugins/love-resources/src/components/ControlExt.svelte index ae7499f9f0..223055ceb0 100644 --- a/plugins/love-resources/src/components/ControlExt.svelte +++ b/plugins/love-resources/src/components/ControlExt.svelte @@ -301,7 +301,8 @@ } function checkActiveVideo (loc: Location, video: boolean, room: Ref | undefined): void { - const isOpened = $sidebarStore.widgetsState.has(love.ids.VideoWidget) + const widgetState = $sidebarStore.widgetsState.get(love.ids.VideoWidget) + const isOpened = widgetState !== undefined if (room === undefined) { if (isOpened) { @@ -319,11 +320,15 @@ { room }, - loc.path[2] !== loveId + { active: loc.path[2] !== loveId, openedByUser: false } ) } - if (loc.path[2] === loveId && $sidebarStore.widget === love.ids.VideoWidget) { + if ( + loc.path[2] === loveId && + $sidebarStore.widget === love.ids.VideoWidget && + widgetState?.openedByUser !== true + ) { minimizeSidebar() } } else { diff --git a/plugins/notification-resources/src/components/NotifyMarker.svelte b/plugins/notification-resources/src/components/NotifyMarker.svelte index b9cf69670a..e4e5e19469 100644 --- a/plugins/notification-resources/src/components/NotifyMarker.svelte +++ b/plugins/notification-resources/src/components/NotifyMarker.svelte @@ -14,7 +14,7 @@ -->