Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
LumosLovegood committed Nov 1, 2022
1 parent 8c36d34 commit 0d39791
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 31 deletions.
2 changes: 1 addition & 1 deletion command/msTodoCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export async function createTodayTasks(todoApi: TodoApi,editor:Editor,dateFormat
const lines = taskList.tasks?.map(task => {
const createDate = window.moment(task.createdDateTime).format(dateFormat);
const done = task.status == "completed" ? "x" : " ";
const date = createDate == now.format(dateFormat) ? "" : "🔎" + createDate;
const date = createDate == now.format(dateFormat) ? "" : `🔎[[${createDate}]]`;
const body = !task.body?.content ? "" : "💡" + task.body.content;

return `- [${done}] ${task.title} ${date} ${body}`;
Expand Down
31 changes: 31 additions & 0 deletions gui/msTodoSyncSettingTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,37 @@ import MsTodoSync from "../main";
import { App, Notice, PluginSettingTab, Setting } from "obsidian";
import { getUptimerToken } from "api/uptimerApi";


export interface MsTodoSyncSettings {
todoListSync: {
listName: string | undefined,
listId: string | undefined,
};
uptimer:{
email: string | undefined,
password: string | undefined,
token: string | undefined
};
bot: {
baseUrl: string,
verifyKey: string,
qq: number,
} | undefined
}

export const DEFAULT_SETTINGS: MsTodoSyncSettings = {
todoListSync:{
listName: undefined,
listId: undefined,
},
uptimer: {
email: undefined,
password: undefined,
token: undefined
},
bot: undefined
}

export class MsTodoSyncSettingTab extends PluginSettingTab {
plugin: MsTodoSync;
constructor(app: App, plugin: MsTodoSync) {
Expand Down
31 changes: 1 addition & 30 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,9 @@ import { TodoApi, MicrosoftClientProvider } from './api/todoApi';
import { UptimerApi } from './api/uptimerApi';
import { Bot, Message } from 'mirai-js'
import { getBiliInfo } from './bot/bilibili';
import { MsTodoSyncSettingTab } from 'gui/msTodoSyncSettingTab';
import { DEFAULT_SETTINGS, MsTodoSyncSettings, MsTodoSyncSettingTab } from 'gui/msTodoSyncSettingTab';
import { createTodayTasks, postTask } from 'command/msTodoCommand';

interface MsTodoSyncSettings {
todoListSync: {
listName: string | undefined,
listId: string | undefined,
};
uptimer:{
email: string | undefined,
password: string | undefined,
token: string | undefined
};
bot: {
baseUrl: string,
verifyKey: string,
qq: number,
} | undefined
}

const DEFAULT_SETTINGS: MsTodoSyncSettings = {
todoListSync:{
listName: undefined,
listId: undefined,
},
uptimer: {
email: undefined,
password: undefined,
token: undefined
},
bot: undefined
}

export default class MsTodoSync extends Plugin {
settings: MsTodoSyncSettings;
Expand Down

0 comments on commit 0d39791

Please sign in to comment.