From fdf9f0d9e4af6dbc2aa03ae54d96a421a1648a28 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 15 May 2023 22:33:36 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/5066 removeData --- app/src/plugin/index.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/src/plugin/index.ts b/app/src/plugin/index.ts index eb05a9a62..d95f8fb5f 100644 --- a/app/src/plugin/index.ts +++ b/app/src/plugin/index.ts @@ -109,6 +109,18 @@ export class Plugin { }); } + public removeData(storageName: string) { + return new Promise((resolve) => { + if (!this.data) { + this.data = {}; + } + fetchPost("/api/file/removeFile", {path: `/data/storage/petal/${this.name}/${storageName}`}, (response) => { + delete this.data[storageName]; + resolve(response); + }); + }); + } + public addTab(options: { type: string, destroy?: () => void,