File tree Expand file tree Collapse file tree
plugins/NativeFullscreen/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import type { LunaUnload } from "@luna/core" ;
2- import { redux } from "@luna/lib" ;
2+ import { observePromise , redux } from "@luna/lib" ;
33import { storage } from "./Settings" ;
44export { Settings } from "./Settings" ;
55
@@ -16,7 +16,12 @@ export const setTopBarVisibility = (visible: boolean) => {
1616 const bar = document . querySelector < HTMLElement > ( "div[class^='_bar']" ) ;
1717 if ( bar ) bar . style . display = visible ? "" : "none" ;
1818} ;
19- if ( storage . hideTopBar ) setTopBarVisibility ( false ) ;
19+ // Apply hideTopBar setting on load
20+ if ( storage . hideTopBar ) {
21+ observePromise < HTMLElement > ( unloads , "div[class^='_bar']" ) . then ( ( bar ) => {
22+ if ( bar ) setTopBarVisibility ( false ) ;
23+ } ) ;
24+ }
2025
2126const onKeyDown = ( event : KeyboardEvent ) => {
2227 if ( event . key === "F11" ) {
@@ -27,7 +32,7 @@ const onKeyDown = (event: KeyboardEvent) => {
2732
2833 if ( document . fullscreenElement || wimp ?. classList . contains ( "is-fullscreen" ) ) {
2934 // Exiting fullscreen
30- document . exitFullscreen ( ) ;
35+ if ( document . fullscreenElement ) document . exitFullscreen ( ) ;
3136 if ( wimp ) wimp . classList . remove ( "is-fullscreen" ) ;
3237 if ( ! storage . hideTopBar ) setTopBarVisibility ( true ) ;
3338 if ( contentContainer ) contentContainer . style . maxHeight = "" ;
You can’t perform that action at this time.
0 commit comments