From b600616516409b04818e49ed1e056b8661bd6e96 Mon Sep 17 00:00:00 2001 From: frostime Date: Sat, 30 Mar 2024 22:02:13 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20=E5=BE=AE=E8=B0=83?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - sql use distinct - remove `save` in `onunload` --- src/func/dailynote/basic.ts | 4 ++-- src/index.ts | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/func/dailynote/basic.ts b/src/func/dailynote/basic.ts index a2a5915..ea76072 100644 --- a/src/func/dailynote/basic.ts +++ b/src/func/dailynote/basic.ts @@ -3,7 +3,7 @@ * @Author : Yp Z * @Date : 2023-11-12 18:06:46 * @FilePath : /src/func/dailynote/basic.ts - * @LastEditTime : 2024-03-29 22:11:08 + * @LastEditTime : 2024-03-30 21:57:20 * @Description : */ import * as serverApi from '@/serverApi'; @@ -37,7 +37,7 @@ export async function getDailynoteSprig(notebookId: string): Promise { export async function queryTodayDailyNoteDoc(notebookId: NotebookId): Promise { let td = formatDate(new Date()); const sql = ` - select B.* from blocks as B join attributes as A + select distinct B.* from blocks as B join attributes as A on B.id = A.block_id where A.name = 'custom-dailynote-${td}' and B.box = '${notebookId}' `; diff --git a/src/index.ts b/src/index.ts index fc6ad2f..d727ccc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -228,8 +228,6 @@ export default class DailyNoteTodayPlugin extends Plugin { debug('Plugin unload') removeStyleSheet(); this.toolbarItem.release(); - settings.save(); - reservation.save(); if (this.upToDate) { debug(`清理定时器 ${this.upToDate}`); clearTimeout(this.upToDate);