fix: entry thumbnail keep origin aspect ratio

Signed-off-by: Innei <i@innei.in>
This commit is contained in:
Innei 2024-10-26 15:20:50 +08:00
parent 87717d6426
commit 6e04e6eacd
No known key found for this signature in database
GPG Key ID: 0F62D33977F021F7
2 changed files with 9 additions and 1 deletions

View File

@ -206,7 +206,7 @@ export function ListItem({
loading="lazy"
proxy={{
width: 160,
height: 160,
height: 0,
}}
height={entry.entries.media[0].height}
width={entry.entries.media[0].width}

View File

@ -46,6 +46,8 @@ export const circularImportRefreshPlugin = (): Plugin => ({
name: "circular-import-refresh",
handleHotUpdate({ file, server }: HmrContext) {
const mod = server.moduleGraph.getModuleById(file)
// Check for circular imports
if (mod && isNodeWithinCircularImports(mod, [mod])) {
console.error(
red(
@ -56,5 +58,11 @@ export const circularImportRefreshPlugin = (): Plugin => ({
server.ws.send({ type: "full-reload" })
return []
}
if (file.startsWith(path.resolve(process.cwd(), "src/store")) && file.endsWith(".ts")) {
console.warn(yellow(`[memory-hmr] Detected change in store file: ${file}. Reloading page.`))
server.ws.send({ type: "full-reload" })
return []
}
},
})