From 1619896c5e9d5f8d4597db68ee9cbee16fee3339 Mon Sep 17 00:00:00 2001 From: Dave Date: Sat, 26 Oct 2024 12:22:40 +0700 Subject: [PATCH] Added a default value --- static/worksheets/api/unlods.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/worksheets/api/unlods.js b/static/worksheets/api/unlods.js index 4913708..3fb3ad8 100644 --- a/static/worksheets/api/unlods.js +++ b/static/worksheets/api/unlods.js @@ -1,6 +1,6 @@ unlods = document.getElementById('onbeforeunload'); window.addEventListener('load', () => { - unlods.value = localStorage.getItem('onbeforeunload'); + unlods.value = localStorage.getItem('onbeforeunload') || "true"; }); document.getElementById('onbeforeunloadForm').addEventListener('submit', (event) => { onbeforeunloadSetting = document.getElementById('onbeforeunload').value;