Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 20 additions & 8 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ if (import.meta.env.VITE_MODE === 'web') {

const { weekStartDay, todoist } = getInitialSettings()

const showAgenda2 = () => {
track('Show Agenda2', { version: __APP_VERSION__ })
renderApp(false)
managePluginTheme()
logseq.showMainUI()
window.isMounted = false
}

const showAgenda3 = () => {
track('Show Agenda', { version: __APP_VERSION__ })
if (window.isMounted !== true) {
Expand All @@ -91,13 +99,7 @@ if (import.meta.env.VITE_MODE === 'web') {

// ===== logseq plugin model start =====
logseq.provideModel({
show() {
track('Show Agenda2', { version: __APP_VERSION__ })
renderApp(false)
managePluginTheme()
logseq.showMainUI()
window.isMounted = false
},
showAgenda2,
showAgenda3,
hide() {
logseq.hideMainUI()
Expand All @@ -116,7 +118,7 @@ if (import.meta.env.VITE_MODE === 'web') {
// ========== show or hide app start =========
logseq.App.registerUIItem('toolbar', {
key: 'Agenda2-Legacy',
template: '<a data-on-click="show" class="button"><i class="ti ti-comet"></i></a>',
template: '<a data-on-click="showAgenda2" class="button"><i class="ti ti-comet"></i></a>',
})
logseq.App.registerUIItem('toolbar', {
key: 'Agenda3',
Expand All @@ -128,6 +130,16 @@ if (import.meta.env.VITE_MODE === 'web') {
}
})
listenEsc(() => logseq.hideMainUI())
logseq.App.registerCommandPalette(
{
key: 'Agenda:showLegacy',
label: 'Show Agenda Legacy',
keybinding: {} as any,
},
(data) => {
showAgenda3()
},
)
logseq.App.registerCommandPalette(
{
key: 'Agenda:show',
Expand Down