fix: exitFullscreen

Signed-off-by: Lachezar Lechev <lachezar@ambire.com>
This commit is contained in:
Lachezar Lechev 2025-05-12 13:45:53 +03:00
parent 242a4a8110
commit f8ab1a7dbc
No known key found for this signature in database
GPG key ID: FDC9325CE311E8A4

View file

@ -22,7 +22,9 @@ const useFullscreen = () => {
if (shell.active) {
shell.send('win-set-visibility', { fullscreen: false });
} else {
document.exitFullscreen();
if (document.fullscreenElement === document.documentElement) {
document.exitFullscreen();
}
}
}, []);