Skip to content

Commit

Permalink
⚡️ 微调代码
Browse files Browse the repository at this point in the history
- sql use distinct
- remove `save` in `onunload`
  • Loading branch information
frostime committed Mar 30, 2024
1 parent 7472259 commit b600616
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/func/dailynote/basic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -37,7 +37,7 @@ export async function getDailynoteSprig(notebookId: string): Promise<string> {
export async function queryTodayDailyNoteDoc(notebookId: NotebookId): Promise<Block[]> {
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}'
`;
Expand Down
2 changes: 0 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b600616

Please sign in to comment.