Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
LiveDuo committed Dec 21, 2023
1 parent bfe06ff commit 0bb10b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/client/vanilla/editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const isEventOnElement = (element: HTMLElement, event: React.MouseEvent<HTMLElem
}

const isElementTopHalf = (element: HTMLElement, event: React.MouseEvent<HTMLElement>) => {
if (!element) return
const rect = element.getBoundingClientRect()
return rect.top + (rect.bottom - rect.top) / 2 > event.clientY
}
Expand Down
4 changes: 3 additions & 1 deletion lib/server/api/handle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ const handleTheme = async (req: NextApiRequest, res: NextApiResponse): Promise<v
// handle request
const themeName = req.query.name as string
const folderPath = path.join(getPackagePath() as string, 'themes', themeName)
const componentNames = await fs.promises.readdir(folderPath).then((f) => f.filter((c) => c !== 'index.ts'))
const componentNames = await fs.promises
.readdir(folderPath)
.then((f) => f.filter((c) => c !== 'index.ts' && !c.startsWith('.')))
const componentsP = componentNames.map(async (c) => {
const assetPath = path.join(folderPath, c, 'index.html')
const source = await fs.promises.readFile(assetPath, 'utf-8')
Expand Down

0 comments on commit 0bb10b7

Please sign in to comment.