From 2d4ef194ef6a2005293bae0ea8e5b5ea0fbfd6e9 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 31 May 2020 21:18:34 +0100 Subject: [PATCH] made sure the db error will actually show --- public/js/db.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/public/js/db.js b/public/js/db.js index ad2a6ac08..2cb7b8047 100644 --- a/public/js/db.js +++ b/public/js/db.js @@ -11,9 +11,11 @@ function db_testCompleted(obj) { if (user) { uid = user.uid; } - db.collection('results').add(obj).catch(e =>{ - showNotification("Error saving result! Please contact Miodec on Discord."); - }) + try{ + db.collection('results').add(obj); + }catch(e){ + showNotification("Error saving result! Please contact Miodec on Discord.",5000); + } } async function db_getUserResults() {