From bb93ac1c83fd8d13593f7f9688de02eba60de913 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Mon, 21 Aug 2023 06:50:29 +0000
Subject: [PATCH] docs: fix links to networked thought

---
 quartz/bootstrap-cli.mjs |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/quartz/bootstrap-cli.mjs b/quartz/bootstrap-cli.mjs
index f7f5504..616f2ef 100755
--- a/quartz/bootstrap-cli.mjs
+++ b/quartz/bootstrap-cli.mjs
@@ -423,13 +423,12 @@
 
     const rebuild = (clientRefresh) => {
       timeoutIds.forEach((id) => clearTimeout(id))
+      timeoutIds.clear()
       timeoutIds.add(setTimeout(() => build(clientRefresh), 250))
     }
 
     if (argv.serve) {
-      const wss = new WebSocketServer({ port: 3001 })
       const connections = []
-      wss.on("connection", (ws) => connections.push(ws))
       const clientRefresh = () => connections.forEach((conn) => conn.send("rebuild"))
 
       if (argv.baseDir !== "" && !argv.baseDir.startsWith("/")) {
@@ -514,6 +513,8 @@
         return serve()
       })
       server.listen(argv.port)
+      const wss = new WebSocketServer({ port: 3001 })
+      wss.on("connection", (ws) => connections.push(ws))
       console.log(
         chalk.cyan(
           `Started a Quartz server listening at http://localhost:${argv.port}${argv.baseDir}`,

--
Gitblit v1.10.0