Skip to content

Commit 599df0c

Browse files
create folder
Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
1 parent 63ba238 commit 599df0c

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

iOSClient/Extensions/UIAlertController+Extension.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ extension UIAlertController {
9999
metadata.sessionDate = Date()
100100

101101
NCManageDatabase.shared.addMetadata(metadata)
102+
103+
NotificationCenter.default.postOnGlobal(name: NCGlobal.shared.notificationCenterNetworkProcess, second: 0.1)
102104
#endif
103105
}
104106
})

iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,8 @@ extension NCCollectionViewCommon: NCTransferDelegate {
880880
}
881881

882882
if status == self.global.networkingStatusCreateFolder {
883-
if serverUrl == self.serverUrl,
883+
if error == .success,
884+
serverUrl == self.serverUrl,
884885
selector != self.global.selectorUploadAutoUpload,
885886
let metadata = await NCManageDatabase.shared.getMetadataAsync(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@ AND fileName == %@", account, serverUrl, fileName)) {
886887
self.pushMetadata(metadata)

iOSClient/Networking/NCNetworkingProcess.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ actor NCNetworkingProcess {
3333
private var timer: DispatchSourceTimer?
3434
private let timerQueue = DispatchQueue(label: "com.nextcloud.timerProcess", qos: .utility)
3535
private var lastUsedInterval: TimeInterval = 3.5
36+
private let offlineInterval: TimeInterval = 10.0
3637
private let maxInterval: TimeInterval = 3.5
3738
private let minInterval: TimeInterval = 2.5
3839

@@ -195,8 +196,7 @@ actor NCNetworkingProcess {
195196
return
196197
}
197198

198-
guard networking.isOnline,
199-
!currentAccount.isEmpty,
199+
guard !currentAccount.isEmpty,
200200
networking.noServerErrorAccount(currentAccount)
201201
else {
202202
return
@@ -251,7 +251,9 @@ actor NCNetworkingProcess {
251251

252252
// TODO: Check temperature
253253

254-
if lastUsedInterval != minInterval {
254+
if !networking.isOnline {
255+
await startTimer(interval: offlineInterval)
256+
} else if lastUsedInterval != minInterval {
255257
await startTimer(interval: minInterval)
256258
}
257259
} else {

0 commit comments

Comments
 (0)