Rewrote ctdl_startup() using fetch/await
authorArt Cancro <ajc@citadel.org>
Sat, 26 Dec 2020 20:02:31 +0000 (15:02 -0500)
committerArt Cancro <ajc@citadel.org>
Sat, 26 Dec 2020 20:02:31 +0000 (15:02 -0500)
webcit-ng/static/js/main.js

index 8aa87112162cb612f28c5e3df060241ea969df70..0abc6ae7f8a577399f092b870c694f47b3bfb2b2 100644 (file)
@@ -88,10 +88,9 @@ function ctdl_startup() {
        const csa = async () => {
                console.log("starting");
                const response = await fetch("/ctdl/c/info");
-               const the_text = await(response.text());
+               serv_info = await(response.json());
 
                if (response.ok) {
-                       serv_info = JSON.parse(the_text);
                        if (serv_info.serv_rev_level < 905) {
                                alert("Citadel server is too old, some functions may not work");
                        }