Slight performance tweaks
This commit is contained in:
parent
bc78fae5ec
commit
16b8d4ef12
@ -1028,7 +1028,7 @@ export class Client {
|
||||
console.error,
|
||||
);
|
||||
console.log("Flushed image height cache to store");
|
||||
}, 5000);
|
||||
}, 2000);
|
||||
|
||||
setCachedImageHeight(url: string, height: number) {
|
||||
this.imageHeightCache.set(url, height);
|
||||
@ -1047,7 +1047,7 @@ export class Client {
|
||||
console.error,
|
||||
);
|
||||
// console.log("Flushed widget height cache to store");
|
||||
}, 5000);
|
||||
}, 2000);
|
||||
|
||||
setCachedWidgetHeight(bodyText: string, height: number) {
|
||||
this.widgetHeightCache.set(bodyText, height);
|
||||
@ -1063,7 +1063,7 @@ export class Client {
|
||||
console.error,
|
||||
);
|
||||
console.log("Flushed widget cache to store");
|
||||
}, 5000);
|
||||
}, 2000);
|
||||
|
||||
setWidgetCache(key: string, cacheItem: WidgetCacheItem) {
|
||||
this.widgetCache.set(key, cacheItem);
|
||||
|
@ -54,7 +54,10 @@ export class MarkdownWidget extends WidgetType {
|
||||
activeWidgets.add(this);
|
||||
if (!widgetContent) {
|
||||
div.innerHTML = "";
|
||||
// div.style.display = "none";
|
||||
this.client.setWidgetCache(
|
||||
this.bodyText,
|
||||
{ height: div.clientHeight, html: "" },
|
||||
);
|
||||
return;
|
||||
}
|
||||
const lang = buildMarkdown(this.client.system.mdExtensions);
|
||||
|
@ -468,7 +468,7 @@
|
||||
.sb-markdown-widget,
|
||||
.sb-markdown-top-widget:has(*),
|
||||
.sb-markdown-bottom-widget:has(*) {
|
||||
overflow-y: scroll;
|
||||
overflow-y: auto;
|
||||
border: 1px solid var(--editor-directive-background-color);
|
||||
border-radius: 5px;
|
||||
white-space: wrap;
|
||||
|
Loading…
Reference in New Issue
Block a user