From 0ca05e297d6a829337368816b9a14fc26eeea347 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Wed, 1 Feb 2023 23:40:21 +0000 Subject: [PATCH] No more global settings file. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4161 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- core/core.js | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/core/core.js b/core/core.js index 3b4b3e4c..60023049 100644 --- a/core/core.js +++ b/core/core.js @@ -38,8 +38,6 @@ let gGlobalSettings = { index: "/~core/apps/", }; -let kGlobalSettingsFile = "data/global/settings.json"; - let kPingInterval = 60 * 1000; function printError(out, error) { @@ -769,8 +767,7 @@ ssb.addEventListener('connections', function() { }); async function loadSettings() { - let data; - + let data = {}; try { let settings = new Database('core').get('settings'); if (settings) { @@ -779,19 +776,7 @@ async function loadSettings() { } catch (error) { print("Settings not found in database:", error); } - - if (!data) { - try { - data = JSON.parse(utf8Decode(await File.readFile(kGlobalSettingsFile))); - new Database('core').set('settings', JSON.stringify(data)); - } catch (error) { - print("Unable to load settings from " + kGlobalSettingsFile + ":", error); - } - } - - if (data) { - gGlobalSettings = data; - } + gGlobalSettings = data; } function sendStats() {