mirror of https://github.com/logseq/logseq
fix(ios): delay unlink event by 500ms
parent
5c1ef22e8e
commit
df70190f60
|
@ -48,10 +48,12 @@ public class FsWatcher: CAPPlugin, PollingWatcherDelegate {
|
||||||
// NOTE: Event in js {dir path content stat{mtime}}
|
// NOTE: Event in js {dir path content stat{mtime}}
|
||||||
switch event {
|
switch event {
|
||||||
case .Unlink:
|
case .Unlink:
|
||||||
self.notifyListeners("watcher", data: ["event": "unlink",
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
|
||||||
"dir": baseUrl?.description as Any,
|
self.notifyListeners("watcher", data: ["event": "unlink",
|
||||||
"path": url.description,
|
"dir": self.baseUrl?.description as Any,
|
||||||
])
|
"path": url.description,
|
||||||
|
])
|
||||||
|
}
|
||||||
case .Add, .Change:
|
case .Add, .Change:
|
||||||
var content: String? = nil
|
var content: String? = nil
|
||||||
if url.shouldNotifyWithContent() {
|
if url.shouldNotifyWithContent() {
|
||||||
|
|
Loading…
Reference in New Issue