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

@ -10,6 +10,15 @@ import globalize from '../scripts/globalize';
return originalString.replace(reg, strWith);
}
function useNativeAlert() {
// webOS seems to block modals
// Tizen 2.x seems to block modals
return !browser.web0s
&& !(browser.tizenVersion && browser.tizenVersion < 3)
&& browser.tv
&& window.alert;
}
export default async function (text, title) {
let options;
if (typeof text === 'string') {
@ -21,7 +30,7 @@ import globalize from '../scripts/globalize';
options = text;
}
if (browser.tv && window.alert) {
if (useNativeAlert()) {
await appRouter.ready();
alert(replaceAll(options.text || '', '<br/>', '\n'));
return Promise.resolve();