Don't fix theme-color if media modal is showing

This commit is contained in:
Lim Chee Aun 2024-11-06 20:29:30 +08:00
parent 451fc1bf52
commit 4e56faa7c8

View file

@ -210,6 +210,12 @@ const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent);
if (isIOS) { if (isIOS) {
document.addEventListener('visibilitychange', () => { document.addEventListener('visibilitychange', () => {
if (document.visibilityState === 'visible') { if (document.visibilityState === 'visible') {
// Don't reset theme color if media modal is showing
// Media modal will set its own theme color based on the media's color
const showingMediaModal =
document.getElementsByClassName('media-modal-container').length > 0;
if (showingMediaModal) return;
const theme = store.local.get('theme'); const theme = store.local.get('theme');
let $meta; let $meta;
if (theme) { if (theme) {