Skip to content

Commit

Permalink
BUG refresh did not clean up previous results.
Browse files Browse the repository at this point in the history
  • Loading branch information
symunona committed Oct 16, 2023
1 parent fa802e4 commit 9efb0f1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "bulk-exporter",
"name": "Bulk Exporter",
"version": "1.0.10",
"version": "1.0.11",
"minAppVersion": "0.15.0",
"description": "Use Dataview queries to export a set of notes with assets",
"author": "symunona",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bulk-exporter",
"version": "1.0.10",
"version": "1.0.11",
"description": "Export structured data for Obsidian (https://obsidian.md)",
"main": "main.js",
"scripts": {
Expand Down
5 changes: 4 additions & 1 deletion src/ui/render-export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Handles collapse and open.
*/

import { Notice, Plugin } from "obsidian";
import { Notice } from "obsidian";
import { revealInFolder } from "../obsidian-api-helpers/file-explorer";
import { getIcon } from "../obsidian-api-helpers/get-icon";
import { createLink, isHttpUrl } from "../utils/url";
Expand Down Expand Up @@ -263,7 +263,10 @@ export class ExportTableRender {
} else {
td.createSpan({ cls: 'meta-value', text: value })
}
}

remove(){
this.leaf.remove();
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export class BulkExporterView extends ItemView {
refreshButton: HTMLButtonElement;
logButton: HTMLButtonElement;
clearLogButton: HTMLButtonElement;
exportTable: ExportTableRender;

constructor(leaf: WorkspaceLeaf, plugin: BulkExporterPlugin) {
super(leaf);
Expand Down Expand Up @@ -157,7 +158,8 @@ export class BulkExporterView extends ItemView {
* @param results
*/
renderPreviewTable(results: ExportMap) {
new ExportTableRender(
if (this.exportTable) this.exportTable.remove()
this.exportTable = new ExportTableRender(
this.results,
results,
this.plugin
Expand Down

0 comments on commit 9efb0f1

Please sign in to comment.