Skip to content

Commit 801231a

Browse files
Will LatourelleWill Latourelle
authored andcommitted
old iphone fix
1 parent 7bdcefa commit 801231a

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

dist/animated-background.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,12 +501,17 @@ function processDefaultBackground(temp_enabled) {
501501
}
502502

503503
if (view_node || view_node_panel) {
504+
//required because ios pre 13.4 bitches out if there is nullish coalescing operator ('??')
505+
var iphone_bullshit_fixer = view_node;
506+
if(!iphone_bullshit_fixer){
507+
iphone_bullshit_fixer = view_node_panel;
508+
}
504509
if (temp_enabled) {
505-
removeDefaultBackground(view_node ?? view_node_panel);
510+
removeDefaultBackground(iphone_bullshit_fixer);
506511
DEBUG_MESSAGE("Removing view background for configuration:", currentConfig(), true);
507512
}
508513
else {
509-
restoreDefaultBackground(view_node ?? view_node_panel);
514+
restoreDefaultBackground(iphone_bullshit_fixer);
510515
if (current_config && current_config.reason) {
511516
DEBUG_MESSAGE("Current config is disabled because " + current_config.reason, null, true);
512517
}
@@ -594,6 +599,11 @@ function run() {
594599
renderBackgroundHTML();
595600
}
596601
}
602+
603+
if(!View){
604+
restart();
605+
return;
606+
}
597607

598608
View_Observer.observe(View, {
599609
characterData: true,
@@ -620,6 +630,7 @@ function run() {
620630
}
621631

622632
function restart() {
633+
clearInterval(wait_interval);
623634
var wait_interval = setInterval(() => {
624635
getVars()
625636
if (Hui) {

0 commit comments

Comments
 (0)