Change refresh label to use "Updated" instead of "Refreshed"
This commit is contained in:
parent
e1a571fab3
commit
8304b174bf
@ -30,16 +30,21 @@ class RefreshProgressView: UIView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func updateRefreshLabel() {
|
func updateRefreshLabel() {
|
||||||
if let refreshDate = AppDefaults.lastRefresh {
|
if let lastRefresh = AppDefaults.lastRefresh {
|
||||||
|
if Date() > lastRefresh.addingTimeInterval(1) {
|
||||||
let relativeDateTimeFormatter = RelativeDateTimeFormatter()
|
let relativeDateTimeFormatter = RelativeDateTimeFormatter()
|
||||||
relativeDateTimeFormatter.dateTimeStyle = .named
|
relativeDateTimeFormatter.dateTimeStyle = .named
|
||||||
let refreshed = relativeDateTimeFormatter.localizedString(for: refreshDate, relativeTo: Date())
|
let refreshed = relativeDateTimeFormatter.localizedString(for: lastRefresh, relativeTo: Date())
|
||||||
let localizedRefreshText = NSLocalizedString("Refreshed %@", comment: "Refreshed")
|
let localizedRefreshText = NSLocalizedString("Updated %@", comment: "Updated")
|
||||||
let refreshText = NSString.localizedStringWithFormat(localizedRefreshText as NSString, refreshed) as String
|
let refreshText = NSString.localizedStringWithFormat(localizedRefreshText as NSString, refreshed) as String
|
||||||
label.text = refreshText
|
label.text = refreshText
|
||||||
|
} else {
|
||||||
|
label.text = NSLocalizedString("Updated just now", comment: "Updated Just Now")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@objc func progressDidChange(_ note: Notification) {
|
@objc func progressDidChange(_ note: Notification) {
|
||||||
|
|
||||||
let progress = AccountManager.shared.combinedRefreshProgress
|
let progress = AccountManager.shared.combinedRefreshProgress
|
||||||
|
Loading…
x
Reference in New Issue
Block a user