Skip to content

Commit

Permalink
fix(ios): delay unlink event by 500ms
Browse files Browse the repository at this point in the history
  • Loading branch information
andelf committed Jul 13, 2022
1 parent 5c1ef22 commit df70190
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ios/App/App/FsWatcher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@ public class FsWatcher: CAPPlugin, PollingWatcherDelegate {
// NOTE: Event in js {dir path content stat{mtime}}
switch event {
case .Unlink:
self.notifyListeners("watcher", data: ["event": "unlink",
"dir": baseUrl?.description as Any,
"path": url.description,
])
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
self.notifyListeners("watcher", data: ["event": "unlink",
"dir": self.baseUrl?.description as Any,
"path": url.description,
])
}
case .Add, .Change:
var content: String? = nil
if url.shouldNotifyWithContent() {
Expand Down

0 comments on commit df70190

Please sign in to comment.