зеркало из https://github.com/nextcloud/ios.git
Added default application (widget)
Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
This commit is contained in:
Родитель
744cdfb36f
Коммит
7a7098c1c1
|
@ -91,8 +91,9 @@ func getDashboardDataEntry(intent: Applications?, isPreview: Bool, displaySize:
|
|||
return completion(DashboardDataEntry(date: Date(), datas: datasPlaceholder, tableDashboard: nil, tableButton: nil, isPlaceholder: true, titleImage: UIImage(named: "widget")!, title: "Dashboard", footerImage: "xmark.icloud", footerText: NSLocalizedString("_no_active_account_", comment: "")))
|
||||
}
|
||||
|
||||
// Default widget: recommendations
|
||||
let id: String = intent?.identifier ?? "recommendations"
|
||||
// Default widget
|
||||
let result = NCManageDatabase.shared.getDashboardWidgetApplications(account: account.account).first
|
||||
let id: String = intent?.identifier ?? (result?.id ?? "recommendations")
|
||||
|
||||
let serverVersionMajor = NCManageDatabase.shared.getCapabilitiesServerInt(account: account.account, elements: NCElementsJSON.shared.capabilitiesVersionMajor)
|
||||
|
||||
|
|
|
@ -26,7 +26,17 @@ class IntentHandler: INExtension, DashboardIntentHandling {
|
|||
applications.append(application)
|
||||
}
|
||||
|
||||
let collection = INObjectCollection(items: applications)
|
||||
completion(collection, nil)
|
||||
completion(INObjectCollection(items: applications), nil)
|
||||
}
|
||||
|
||||
func defaultApplications(for intent: DashboardIntent) -> Applications? {
|
||||
|
||||
guard let account = NCManageDatabase.shared.getActiveAccount() else {
|
||||
return nil
|
||||
}
|
||||
if let result = NCManageDatabase.shared.getDashboardWidgetApplications(account: account.account).first {
|
||||
return Applications(identifier: result.id, display: result.title)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче