diff --git a/src/components/ModifyPomodoro.tsx b/src/components/ModifyPomodoro.tsx index 0e41d763..053d3d0c 100644 --- a/src/components/ModifyPomodoro.tsx +++ b/src/components/ModifyPomodoro.tsx @@ -53,7 +53,7 @@ const ModifyPomodoro: React.FC<{ - + diff --git a/src/components/ModifySchedule.tsx b/src/components/ModifySchedule.tsx index aa9011d7..4d48fbe1 100644 --- a/src/components/ModifySchedule.tsx +++ b/src/components/ModifySchedule.tsx @@ -220,10 +220,10 @@ const ModifySchedule: React.FC<{ - + - + diff --git a/src/components/PomodoroModal.tsx b/src/components/PomodoroModal.tsx index 6746e67d..138b27ff 100644 --- a/src/components/PomodoroModal.tsx +++ b/src/components/PomodoroModal.tsx @@ -51,8 +51,8 @@ const PomodoroModal: React.FC<{ { title: 'Full Tomato', dataIndex: 'isFull', render(value, record, index) { return value ? '✅' : '❌' }, }, - { title: 'Start', dataIndex: 'start', width: '200px', render: (value) => dayjs(value).format('YYYY-MM-DD HH:mm') }, { title: 'Length', dataIndex: 'length', render: value => `${Math.ceil(value / 60)} min` }, + { title: 'Start', dataIndex: 'start', width: '200px', render: (value) => dayjs(value).format('YYYY-MM-DD HH:mm') }, Table.EXPAND_COLUMN, { title: 'Interruption', diff --git a/src/constants/style.ts b/src/constants/style.ts index 27df1797..187fc891 100644 --- a/src/constants/style.ts +++ b/src/constants/style.ts @@ -26,6 +26,7 @@ export const LOGSEQ_PROVIDE_COMMON_STYLE = ` border-radius: 4px; padding: 1px 6px; color: #222; + white-space: nowrap; } .dark .external-link[href^="#agenda-pomo://"] { background-color: #1a543b; diff --git a/src/main.tsx b/src/main.tsx index f94610e4..a14cb65b 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -261,7 +261,8 @@ async function renderApp(env: string) { let defaultRoute = '' const page = await logseq.Editor.getCurrentPage() const { projectList = [] } = getInitalSettings() - if (isEnabledAgendaPage(page?.originalName) || projectList.some(project => project.id === page?.originalName)) defaultRoute = `project/${encodeURIComponent(page?.originalName)}` + if (projectList.some(project => Boolean(project.id) && project.id === page?.originalName)) defaultRoute = `project/${encodeURIComponent(page?.originalName)}` + console.log('[faiz:] === defaultRoute', defaultRoute) ReactDOM.render( {/* */} diff --git a/src/pages/Settings/index.tsx b/src/pages/Settings/index.tsx index 1d9f6144..7f3c23ee 100644 --- a/src/pages/Settings/index.tsx +++ b/src/pages/Settings/index.tsx @@ -42,7 +42,7 @@ const Settings: React.FC<{ const [pageOptions, setPageOptions] = useState([]) const [createCalendarModalVisible, setCreateCalendarModalVisible] = useState(false) - const initialValues = getInitalSettings() + const initialValues = getInitalSettings({ filterInvalideProject: false }) // TODO: 使用 only-write 减少重新渲染 const [, setProjectSchedules] = useAtom(projectSchedulesAtom) const [, setSubscriptionSchedules] = useAtom(subscriptionSchedulesAtom) diff --git a/src/util/baseInfo.ts b/src/util/baseInfo.ts index 6f16cb38..244c0bd3 100644 --- a/src/util/baseInfo.ts +++ b/src/util/baseInfo.ts @@ -3,7 +3,8 @@ import { ISchedule } from 'tui-calendar' import { CALENDAR_THEME, DEFAULT_SETTINGS } from './constants' import { ISettingsForm } from './type' -export const getInitalSettings = (): ISettingsForm => { +export const getInitalSettings = (params = { filterInvalideProject: true }): ISettingsForm => { + const { filterInvalideProject } = params let logKey = DEFAULT_SETTINGS.logKey const settingLogKey = logseq.settings?.logKey if (settingLogKey) { @@ -35,11 +36,13 @@ export const getInitalSettings = (): ISettingsForm => { // }, // ...calendarList.slice(1), // ] + const projectList = logseq.settings?.projectList || DEFAULT_SETTINGS.projectList return { ...DEFAULT_SETTINGS, ...logseq.settings, // calendarList, logKey, + projectList: filterInvalideProject ? projectList?.filter(project => Boolean(project.id)) : projectList, } }