mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-21 12:35:52 +03:00
Add method to report a change in sync state if applicable in FileProviderExt
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
5237822221
commit
885d9f3566
1 changed files with 18 additions and 0 deletions
|
@ -132,4 +132,22 @@ extension FileProviderExtension: NSFileProviderServicing, ChangeNotificationInte
|
|||
)
|
||||
ncAccount = nil
|
||||
}
|
||||
|
||||
func updatedSyncStateReporting(oldActions: Set<UUID>) {
|
||||
guard oldActions.isEmpty != syncActions.isEmpty else { return }
|
||||
|
||||
let command = "FILE_PROVIDER_DOMAIN_SYNC_STATE_CHANGE"
|
||||
var argument: String?
|
||||
if oldActions.isEmpty, !syncActions.isEmpty {
|
||||
argument = "SYNC_STARTED"
|
||||
} else if !oldActions.isEmpty, syncActions.isEmpty {
|
||||
argument = errorActions.isEmpty ? "SYNC_FINISHED" : "SYNC_FAILED"
|
||||
errorActions = []
|
||||
}
|
||||
|
||||
guard let argument else { return }
|
||||
Logger.fileProviderExtension.debug("Reporting sync \(argument)")
|
||||
let message = command + ":" + argument + "\n"
|
||||
socketClient?.sendMessage(message)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue