From 859b4f9d721078531408b4cf4b466e02142b92c7 Mon Sep 17 00:00:00 2001 From: frostime Date: Fri, 13 Sep 2024 12:15:13 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20=E4=BD=BF=E7=94=A8=20Alt+5?= =?UTF-8?q?=20=E6=89=93=E5=BC=80=E6=97=A5=E8=AE=B0=E4=B9=8B=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E6=A3=80=E6=9F=A5=E9=A2=84=E7=BA=A6=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + src/func/index.ts | 4 +++- src/index.ts | 7 ++++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 66ced68..ae1439f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - 🔨 refactor: Dock 栏改为基于查询的方案获取预约信息 - 🔥 rm: 去掉一些基于 reservation 对象的代码,为后面弃用 reservation 对象做准备 +- ✨ feat: 使用 Alt+5 打开日记之后,检查预约情况 ## [2024-09-09] v1.6.7 diff --git a/src/func/index.ts b/src/func/index.ts index 7ec2807..66babc5 100644 --- a/src/func/index.ts +++ b/src/func/index.ts @@ -156,7 +156,9 @@ export class RoutineEventHandler { */ public async tryAutoInsertResv() { //TODO 允许用户配置是否每次打开都尝试更新预约 - if (this.flag.hasAutoInsertResv === true) return; + // v1.6.8 Note: 把这里的限制去掉,让每次打开的时候都尝试插入预约 + // 后期看看要不要优化一下 + // if (this.flag.hasAutoInsertResv === true) return; //如果今天没有预约,就不插入 let hasResv = await isTodayReserved(); diff --git a/src/index.ts b/src/index.ts index 8ca0339..220d173 100644 --- a/src/index.ts +++ b/src/index.ts @@ -129,7 +129,12 @@ export default class DailyNoteTodayPlugin extends Plugin { langKey: 'open-dn', langText: this.i18n.Open, hotkey: '⌥5', - callback: openDefaultDailyNote + callback: () => { + //v1.6.8 Note: 在快捷键打开日记之后,同样检查预约情况 + openDefaultDailyNote().then(() => { + this.routineHandler.tryAutoInsertResv(); + }); + } }); toggleGeneralDailynoteKeymap(false); } else {