From 3d271c83d5dc4bf19c9ca7ba8ca80da554bf5cf6 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Sat, 24 Dec 2022 20:10:20 -0500 Subject: [PATCH] Fix bug in last commit. While the last commit prevented a race condition, it also broke the `updateOnce` function. --- src/js/pannellum.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/js/pannellum.js b/src/js/pannellum.js index b25482d..96beacf 100644 --- a/src/js/pannellum.js +++ b/src/js/pannellum.js @@ -3075,7 +3075,10 @@ this.setUpdate = function(bool) { */ this.updateOnce = function() { updateOnce = true; - this.setUpdate(true); + if (renderer === undefined) + onImageLoad(); + else + animateInit(); return this; };