Affects #2845: Reveal found calendar events and contacts in the web user interface.

This commit is contained in:
Iva Horn 2024-11-06 16:10:46 +01:00
Родитель aeb97b0d30
Коммит 8c1b7bbd2d
2 изменённых файлов: 14 добавлений и 3 удалений

Просмотреть файл

@ -28,9 +28,14 @@ import NextcloudKit
extension NCCollectionViewCommon: UICollectionViewDelegate {
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
guard let metadata = self.dataSource.getMetadata(indexPath: indexPath),
!metadata.isInvalidated,
(metadata.name == global.appName || metadata.name == NCGlobal.shared.talkName)
else { return }
!metadata.isInvalidated
else {
return
}
guard [global.appName, global.calendarName, global.contactsName, global.talkName].contains(metadata.name) else {
return
}
if isEditMode {
if let index = fileSelect.firstIndex(of: metadata.ocId) {
@ -57,6 +62,10 @@ extension NCCollectionViewCommon: UICollectionViewDelegate {
}
}
if [global.calendarName, global.contactsName].contains(metadata.name) {
NCViewer().view(viewController: self, metadata: metadata, image: nil)
}
if metadata.directory {
pushMetadata(metadata)
} else {

Просмотреть файл

@ -52,6 +52,8 @@ class NCGlobal: NSObject {
//
let appName = "files"
let appScheme = "nextcloud"
let calendarName = "calendar"
let contactsName = "contacts"
let talkName = "talk-message"
let spreedName = "spreed"
let twoFactorNotificatioName = "twofactor_nextcloud_notification"