migrate angular 21 finalize
This commit is contained in:
@@ -6,12 +6,9 @@ export const openFullscreen = () => {
|
||||
}
|
||||
|
||||
try {
|
||||
const promise = elem.requestFullscreen();
|
||||
if (promise && typeof promise.catch === 'function') {
|
||||
void promise.catch(() => {
|
||||
// Browser may reject when no user gesture is present. Keep app usable.
|
||||
});
|
||||
}
|
||||
void elem.requestFullscreen().catch(() => {
|
||||
// Browser may reject when no user gesture is present. Keep app usable.
|
||||
});
|
||||
} catch {
|
||||
// Some browsers may throw synchronously if fullscreen is not allowed.
|
||||
}
|
||||
@@ -19,11 +16,8 @@ export const openFullscreen = () => {
|
||||
|
||||
export const closeFullscreen = () => {
|
||||
if (document.exitFullscreen) {
|
||||
const promise = document.exitFullscreen();
|
||||
if (promise && typeof promise.catch === 'function') {
|
||||
void promise.catch(() => {
|
||||
// Ignore; leaving fullscreen is a best-effort action.
|
||||
});
|
||||
}
|
||||
void document.exitFullscreen().catch(() => {
|
||||
// Ignore; leaving fullscreen is a best-effort action.
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user