From 09b6244d94b9a176172de448d3bb7fa386cb8995 Mon Sep 17 00:00:00 2001
From: Terry Truong <terry06890@gmail.com>
Date: Sun, 26 Jun 2022 02:18:41 +1000
Subject: Fix redundant option-loading-on-resize bug

---
 src/App.vue | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'src/App.vue')

diff --git a/src/App.vue b/src/App.vue
index 32ab3f8..7576278 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -748,8 +748,9 @@ export default defineComponent({
 						}
 					}
 					for (let prop of Object.getOwnPropertyNames(uiOpts) as (keyof UiOptions)[]){
-						let item = localStorage.getItem(lytOptPrefix + prop);
-						if (item == null && this.uiOpts[prop] != uiOpts[prop]){
+						let item = localStorage.getItem(uiOptPrefix + prop);
+						//Not: Using JSON.stringify here to roughly deep-compare values
+						if (item == null && JSON.stringify(this.uiOpts[prop]) != JSON.stringify(uiOpts[prop])){
 							this.uiOpts[prop] = uiOpts[prop];
 							if (prop == 'useReducedTree'){
 								changedTree = true;
-- 
cgit v1.2.3

