From 329d9ef2dc9a0f6087957a17c9366f138372ed82 Mon Sep 17 00:00:00 2001 From: Cyperghost Date: Mon, 28 Oct 2024 13:30:18 +0100 Subject: [PATCH] Don't add object store on success only in upgrade event function. --- wcfsetup/install/files/service-worker/index.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/wcfsetup/install/files/service-worker/index.php b/wcfsetup/install/files/service-worker/index.php index b388f4cc43..26a97172e9 100644 --- a/wcfsetup/install/files/service-worker/index.php +++ b/wcfsetup/install/files/service-worker/index.php @@ -94,6 +94,7 @@ function openDatabase() { request.onupgradeneeded = (event) => { const db = event.target.result; + if (!db.objectStoreNames.contains("notifications")) { db.createObjectStore("notifications"); } @@ -101,10 +102,6 @@ function openDatabase() { request.onsuccess = (event) => { resolve(event.target.result); - - if (!db.objectStoreNames.contains("notifications")) { - db.createObjectStore("notifications"); - } }; request.onerror = (event) => { -- 2.20.1