Preventing the opening of an empty floating aside ()

Signed-off-by: Alexander Platov <alexander.platov@hardcoreeng.com>
This commit is contained in:
Alexander Platov 2024-12-13 07:15:32 +03:00 committed by GitHub
parent 2e8148595b
commit 088c37fa20
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 1 deletions
plugins/workbench-resources/src

View File

@ -664,6 +664,15 @@
oldNavVisible = $deviceInfo.navigator.visible
oldASideVisible = $deviceInfo.aside.visible
}
$: if (
$deviceInfo.aside.float &&
$deviceInfo.aside.visible &&
$sidebarStore.variant === SidebarVariant.MINI &&
$sidebarStore.widgetsState.size > 0
) {
$sidebarStore.variant = SidebarVariant.EXPANDED
$sidebarStore.widget = Array.from($sidebarStore.widgetsState.keys())[0]
}
$: $deviceInfo.navigator.direction = $deviceInfo.isMobile && $deviceInfo.isPortrait ? 'horizontal' : 'vertical'
let appsMini: boolean
$: appsMini =

View File

@ -339,7 +339,7 @@ export function minimizeSidebar (closedByUser = false): void {
sidebarStore.set({ ...state, ...widgetsState, widget: undefined, variant: SidebarVariant.MINI })
const devInfo = get(deviceInfo)
if (devInfo.navigator.float && devInfo.aside.visible) {
if (devInfo.aside.float && devInfo.aside.visible) {
deviceInfo.set({ ...devInfo, aside: { visible: false, float: true } })
}
}