fix: reset db for external changes

feat/file-sync-crdt
Tienson Qin 2022-06-30 20:36:17 +08:00
parent 58e946fa19
commit efd2d2deef
3 changed files with 21 additions and 22 deletions

View File

@ -11,18 +11,18 @@ module.exports = {
"schemes":"logseq"
}
],
osxSign: {
identity: 'Developer ID Application: Tiansheng Qin',
'hardened-runtime': true,
entitlements: 'entitlements.plist',
'entitlements-inherit': 'entitlements.plist',
'signature-flags': 'library'
},
osxNotarize: {
appleId: process.env['APPLE_ID'],
appleIdPassword: process.env['APPLE_ID_PASSWORD'],
ascProvider: process.env['APPLE_ASC_PROVIDER']
},
// osxSign: {
// identity: 'Developer ID Application: Tiansheng Qin',
// 'hardened-runtime': true,
// entitlements: 'entitlements.plist',
// 'entitlements-inherit': 'entitlements.plist',
// 'signature-flags': 'library'
// },
// osxNotarize: {
// appleId: process.env['APPLE_ID'],
// appleIdPassword: process.env['APPLE_ID_PASSWORD'],
// ascProvider: process.env['APPLE_ASC_PROVIDER']
// },
},
makers: [
{

View File

@ -1,6 +1,6 @@
{
"name": "Logseq",
"version": "0.7.4",
"name": "foobar",
"version": "0.7.6",
"main": "electron.js",
"author": "Logseq",
"license": "AGPL-3.0",

View File

@ -73,15 +73,14 @@
_ (when merged-doc (write-file-fn repo ydoc-path (gobj/get (crdt-yjs/serialize merged-doc) "buffer")))
result (write-file-fn repo path merged-content)
mtime (gobj/get result "mtime")]
(db/set-file-last-modified-at! repo path mtime)
(db/set-file-content! repo path merged-content)
(when (and
;; not triggered by the current client
(not (:outliner/transact? opts))
(or (and merged-doc
(not= merged-content db-content))
(not merged-doc)))
(db/set-file-last-modified-at! repo path mtime)
(when (or (and merged-doc
(not= merged-content content))
;; Detected by the file watcher
(and (nil? (:outliner/transact? opts))
(not= merged-content db-content))
(not merged-doc))
(state/pub-event! [:graph/reset-file repo path merged-content opts]))
(when ok-handler