From 801231a485285b50d5d369d20554fc91a25b4614 Mon Sep 17 00:00:00 2001 From: Will Latourelle Date: Thu, 7 May 2020 14:13:44 -0700 Subject: [PATCH] old iphone fix --- dist/animated-background.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/dist/animated-background.js b/dist/animated-background.js index 3b21bdc..0bd2645 100644 --- a/dist/animated-background.js +++ b/dist/animated-background.js @@ -501,12 +501,17 @@ function processDefaultBackground(temp_enabled) { } if (view_node || view_node_panel) { + //required because ios pre 13.4 bitches out if there is nullish coalescing operator ('??') + var iphone_bullshit_fixer = view_node; + if(!iphone_bullshit_fixer){ + iphone_bullshit_fixer = view_node_panel; + } if (temp_enabled) { - removeDefaultBackground(view_node ?? view_node_panel); + removeDefaultBackground(iphone_bullshit_fixer); DEBUG_MESSAGE("Removing view background for configuration:", currentConfig(), true); } else { - restoreDefaultBackground(view_node ?? view_node_panel); + restoreDefaultBackground(iphone_bullshit_fixer); if (current_config && current_config.reason) { DEBUG_MESSAGE("Current config is disabled because " + current_config.reason, null, true); } @@ -594,6 +599,11 @@ function run() { renderBackgroundHTML(); } } + + if(!View){ + restart(); + return; + } View_Observer.observe(View, { characterData: true, @@ -620,6 +630,7 @@ function run() { } function restart() { + clearInterval(wait_interval); var wait_interval = setInterval(() => { getVars() if (Hui) {