Skip to content

Commit 49466c8

Browse files
committed
Merge branch 'fix/dock-safe-area-on-anchor' into fix/dock-safe-area-px
2 parents 2a4a336 + cc8dfd9 commit 49466c8

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • packages/hub-ui/src/client/components/dock

‎packages/hub-ui/src/client/components/dock/Dock.vue‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ const isSafari = navigator.userAgent.includes('Safari') && !navigator.userAgent.
4141
4242
const anchorEl = useTemplateRef<HTMLDivElement>('anchorEl')
4343
44-
// Port of VueUse's `useScreenSafeArea`, with the variables declared on the
45-
// dock stylesheet's `:host` instead of `<html>`, which SSR hosts hydrate themselves.
4644
const safeArea = {
4745
top: ref(''),
4846
right: ref(''),
@@ -51,7 +49,9 @@ const safeArea = {
5149
}
5250
5351
function updateSafeArea() {
54-
const style = getComputedStyle(anchorEl.value!)
52+
if (!anchorEl.value)
53+
return
54+
const style = getComputedStyle(anchorEl.value)
5555
safeArea.top.value = style.getPropertyValue('--devframes-safe-area-top')
5656
safeArea.right.value = style.getPropertyValue('--devframes-safe-area-right')
5757
safeArea.bottom.value = style.getPropertyValue('--devframes-safe-area-bottom')

0 commit comments

Comments
 (0)