From 4e56faa7c8b90a18c9d6e6ec2cd7aa2fb2cf3e95 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Wed, 6 Nov 2024 20:29:30 +0800 Subject: [PATCH] Don't fix theme-color if media modal is showing --- src/app.jsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app.jsx b/src/app.jsx index f02855b3..8d95cc34 100644 --- a/src/app.jsx +++ b/src/app.jsx @@ -210,6 +210,12 @@ const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent); if (isIOS) { document.addEventListener('visibilitychange', () => { 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'); let $meta; if (theme) {