Skip to content

Commit a2ac2bd

Browse files
committed
feat: ✨ Support for turning off auto-check sync
1 parent 7e22e9c commit a2ac2bd

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

src/helper/constants.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,13 @@ export const SETTINGS_SCHEMA: SettingSchemaDesc[] = [
125125
default: true,
126126
description: 'Check status when DB changed, restart logseq to take effect',
127127
},
128+
{
129+
key: 'autoCheckSynced',
130+
title: 'Auto Check If Synced',
131+
type: 'boolean',
132+
default: false,
133+
description: 'Automatically check if the local version is the same as the remote',
134+
},
128135
{
129136
key: 'autoPush',
130137
title: 'Auto Push',

src/main.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,15 @@ if (isDevelopment) {
109109
})
110110
}
111111

112-
checkIsSynced()
112+
if (logseq.settings?.autoCheckSynced) checkIsSynced()
113113
checkStatusWithDebounce()
114114

115115
if (top) {
116116
top.document?.addEventListener('visibilitychange', async () => {
117117
const visibilityState = top?.document?.visibilityState
118118

119119
if (visibilityState === 'visible') {
120-
checkIsSynced()
120+
if (logseq.settings?.autoCheckSynced) checkIsSynced()
121121
} else if (visibilityState === 'hidden') {
122122
// logseq.UI.showMsg(`Page is hidden: ${new Date()}`, 'success', { timeout: 0 })
123123
// noChange void

0 commit comments

Comments
 (0)