Skip to content

Commit 719a3c7

Browse files
committed
fix(tabs): simplify fullscreen mode update on orientation change
- Moved fullscreen update logic to a dedicated private method updateFullscreenMode - Replaced conditional calls with updateFullscreenMode invocation - Made setLandscapeFullscreen and exitFullscreen calls awaitable with then() - Ensured fullscreen mode updates on initialization and on orientation change events
1 parent 05760ed commit 719a3c7

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

mobile/src/app/tabs/tabs.page.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,17 @@ export class TabsPage {
7070
console.log('Размер экрана изменился');
7171
console.log('Портрет?', this.platform.isPortrait());
7272
console.log('Ландшафт?', this.platform.isLandscape());
73-
if (this.isLandscape()) {
74-
this.setLandscapeFullscreen();
75-
} else {
76-
this.exitFullscreen();
77-
}
73+
this.updateFullscreenMode();
7874
});
7975

76+
this.updateFullscreenMode();
77+
}
78+
79+
private updateFullscreenMode() {
8080
if (this.isLandscape()) {
81-
this.setLandscapeFullscreen();
81+
this.setLandscapeFullscreen().then();
8282
} else {
83-
this.exitFullscreen();
83+
this.exitFullscreen().then();
8484
}
8585
}
8686

0 commit comments

Comments
 (0)