fix(hooks): [use-lockscreen] prevent flaky unit tests (#11404)

This commit is contained in:
Robert Wloch 2023-02-11 16:45:36 +01:00 committed by GitHub
parent a2de1b9c1f
commit 1e3fdde6d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,8 +40,8 @@ export const useLockscreen = (trigger: Ref<boolean>) => {
const cleanup = () => {
setTimeout(() => {
removeClass(document.body, hiddenCls.value)
if (withoutHiddenClass) {
removeClass(document?.body, hiddenCls.value)
if (withoutHiddenClass && document) {
document.body.style.width = bodyWidth
}
}, 200)