Skip to content

Commit 63ba238

Browse files
code
Signed-off-by: Marino Faggiana <marino.faggiana@nextcloud.com>
1 parent 4a4c7e2 commit 63ba238

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

iOSClient/Extensions/NotificationCenter+MainThread.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,9 @@ extension NotificationCenter {
3030
NotificationCenter.default.post(name: Notification.Name(rawValue: name), object: anObject, userInfo: aUserInfo)
3131
}
3232
}
33+
func postOnGlobal(name: String, object anObject: Any? = nil, userInfo aUserInfo: [AnyHashable: Any]? = nil, second: Double = 0) {
34+
DispatchQueue.global().asyncAfter(deadline: .now() + second) {
35+
NotificationCenter.default.post(name: Notification.Name(rawValue: name), object: anObject, userInfo: aUserInfo)
36+
}
37+
}
3338
}

iOSClient/GUI/Lucid Banner/BannerView.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,8 @@ func bannerContainsError(errorCode: Int?, afError: AFError? = nil) -> Bool {
309309
// The same error code is shown to the user only once.
310310
// Error 401 (maintenance mode)
311311
// Error 507 (insufficient storage)
312-
if errorCode == 401 || errorCode == 507 {
312+
// Error -1009 (not connected to internet)
313+
if errorCode == 401 || errorCode == 507 || errorCode == URLError.notConnectedToInternet.rawValue {
313314
shownErrors.insert(errorCode)
314315
}
315316
return false

0 commit comments

Comments
 (0)