From 8cf3e3001f2cbd18da73fcc92ae5f4b76d3ecf21 Mon Sep 17 00:00:00 2001
From: Patsagorn Y. <49602385+ptsgrn@users.noreply.github.com>
Date: Thu, 16 Jan 2025 20:44:33 +0000
Subject: [PATCH] feat(i18n): Thai translations (#1722)
---
quartz/components/Explorer.tsx | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/quartz/components/Explorer.tsx b/quartz/components/Explorer.tsx
index 24583a1..ec7c48e 100644
--- a/quartz/components/Explorer.tsx
+++ b/quartz/components/Explorer.tsx
@@ -44,12 +44,9 @@
// memoized
let fileTree: FileNode
let jsonTree: string
+ let lastBuildId: string = ""
function constructFileTree(allFiles: QuartzPluginData[]) {
- if (fileTree) {
- return
- }
-
// Construct tree from allFiles
fileTree = new FileNode("")
allFiles.forEach((file) => fileTree.add(file))
@@ -76,12 +73,17 @@
}
const Explorer: QuartzComponent = ({
+ ctx,
cfg,
allFiles,
displayClass,
fileData,
}: QuartzComponentProps) => {
- constructFileTree(allFiles)
+ if (ctx.buildId !== lastBuildId) {
+ lastBuildId = ctx.buildId
+ constructFileTree(allFiles)
+ }
+
return (
<div class={classNames(displayClass, "explorer")}>
<button
@@ -91,6 +93,8 @@
data-collapsed={opts.folderDefaultState}
data-savestate={opts.useSavedState}
data-tree={jsonTree}
+ aria-controls="explorer-content"
+ aria-expanded={opts.folderDefaultState === "open"}
>
<h2>{opts.title ?? i18n(cfg.locale).components.explorer.title}</h2>
<svg
--
Gitblit v1.10.0