1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Use custom modals on webOS and Tizen 2.x

This commit is contained in:
Dmitry Lyzo 2021-10-03 10:32:37 +03:00
parent 0831207057
commit 527215e0f0
2 changed files with 20 additions and 2 deletions

View file

@ -7,6 +7,15 @@ function replaceAll(str, find, replace) {
return str.split(find).join(replace);
}
function useNativeConfirm() {
// webOS seems to block modals
// Tizen 2.x seems to block modals
return !browser.web0s
&& !(browser.tizenVersion && browser.tizenVersion < 3)
&& browser.tv
&& window.confirm;
}
async function nativeConfirm(options) {
if (typeof options === 'string') {
options = {
@ -62,6 +71,6 @@ function customConfirm(text, title) {
});
}
const confirm = browser.tv && window.confirm ? nativeConfirm : customConfirm;
const confirm = useNativeConfirm() ? nativeConfirm : customConfirm;
export default confirm;