From e9fb0ecb96a2de53cf5f060c4e151f539ca4b089 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Fri, 02 Feb 2024 05:19:51 +0000
Subject: [PATCH] fix: border radius on search preview

---
 quartz/build.ts |   19 +++++--------------
 1 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/quartz/build.ts b/quartz/build.ts
index b78ff2b..1f90301 100644
--- a/quartz/build.ts
+++ b/quartz/build.ts
@@ -126,17 +126,8 @@
   clientRefresh: () => void,
   buildData: BuildData, // note: this function mutates buildData
 ) {
-  const {
-    ctx,
-    ignored,
-    mut,
-    initialSlugs,
-    contentMap,
-    toRebuild,
-    toRemove,
-    trackedAssets,
-    lastBuildMs,
-  } = buildData
+  const { ctx, ignored, mut, initialSlugs, contentMap, toRebuild, toRemove, trackedAssets } =
+    buildData
 
   const { argv } = ctx
 
@@ -164,12 +155,12 @@
     toRemove.add(filePath)
   }
 
-  // debounce rebuilds every 250ms
-
   const buildStart = new Date().getTime()
   buildData.lastBuildMs = buildStart
   const release = await mut.acquire()
-  if (lastBuildMs > buildStart) {
+
+  // there's another build after us, release and let them do it
+  if (buildData.lastBuildMs > buildStart) {
     release()
     return
   }

--
Gitblit v1.10.0