From 49c831cb627e0ed8d2a214b2cc51f5a3cebed8e7 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Sun, 28 Jan 2024 13:09:31 +0000 Subject: [PATCH] Fix seeding files for a new app. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4808 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- core/client.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/core/client.js b/core/client.js index 49e6e1e4..59ed4e6d 100644 --- a/core/client.js +++ b/core/client.js @@ -473,14 +473,12 @@ function loadFile(name, id) { async function load(path) { let response = await fetch((path || url()) + 'view'); - if (!response.ok) { - if (response.status == 404) { - return null; - } else { - throw new Error(response.status + ' ' + response.statusText); - } + let json; + if (response.ok) { + json = await response.json(); + } else if (response.status != 404) { + throw new Error(response.status + ' ' + response.statusText); } - let json = await response.json(); gFiles = {}; let isApp = false; let promises = [];