Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/ios.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarino Faggiana <marino@marinofaggiana.com>2022-11-02 21:01:06 +0300
committerMarino Faggiana <marino@marinofaggiana.com>2022-11-02 21:01:06 +0300
commitc4c1543d1b86318abc7cd036d6916e0e122fbe1f (patch)
treee9980b60f75b359e5656ed7e9e1a2b39f0828de0
parentf567cee143234e598464cb8b1cb5890b04aca860 (diff)
Improve
Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
-rw-r--r--Widget/Lockscreen/LockscreenData.swift4
-rw-r--r--Widget/Lockscreen/LockscreenWidgetView.swift12
2 files changed, 13 insertions, 3 deletions
diff --git a/Widget/Lockscreen/LockscreenData.swift b/Widget/Lockscreen/LockscreenData.swift
index 6dbbcdbd8..c6c597140 100644
--- a/Widget/Lockscreen/LockscreenData.swift
+++ b/Widget/Lockscreen/LockscreenData.swift
@@ -107,8 +107,10 @@ func getLockscreenDataEntry(configuration: AccountIntent?, isPreview: Bool, fami
if let title = item.title { activity = title }
if let itemLink = item.link, let url = URL(string: itemLink) { link = url }
}
+ completion(LockscreenData(date: Date(), isPlaceholder: false, activity: activity, link: link, quotaRelative: 0, quotaUsed: "", quotaTotal: "", error: false))
+ } else {
+ completion(LockscreenData(date: Date(), isPlaceholder: false, activity: "", link: URL(string: "https://")!, quotaRelative: 0, quotaUsed: "", quotaTotal: "", error: true))
}
- completion(LockscreenData(date: Date(), isPlaceholder: false, activity: activity, link: link, quotaRelative: 0, quotaUsed: "", quotaTotal: "", error: false))
}
}
}
diff --git a/Widget/Lockscreen/LockscreenWidgetView.swift b/Widget/Lockscreen/LockscreenWidgetView.swift
index c252806f3..fdcb1f2b6 100644
--- a/Widget/Lockscreen/LockscreenWidgetView.swift
+++ b/Widget/Lockscreen/LockscreenWidgetView.swift
@@ -66,8 +66,16 @@ struct LockscreenWidgetView: View {
.fontWeight(.heavy)
.foregroundColor(.gray)
}
- Text(entry.activity)
- .font(.system(size: 12)).bold()
+ if entry.error {
+ VStack(spacing: 1) {
+ Image(systemName: "xmark.icloud")
+ .font(.system(size: 25.0))
+ .frame(maxWidth: .infinity, alignment: .center)
+ }.padding(8)
+ } else {
+ Text(entry.activity)
+ .font(.system(size: 12)).bold()
+ }
}
.widgetURL(entry.link)
.redacted(reason: entry.isPlaceholder ? .placeholder : [])