mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-24 10:15:37 +03:00
Don't fix theme-color if media modal is showing
This commit is contained in:
parent
451fc1bf52
commit
4e56faa7c8
1 changed files with 6 additions and 0 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue