Skip to content

Commit

Permalink
Only show media button if there's media to view
Browse files Browse the repository at this point in the history
We also move the media gallery button above the "show shared media and
files" one as users will generally prefer the media gallery.
  • Loading branch information
matthewrfennell authored and tmolitor-stud-tu committed Sep 25, 2024
1 parent 48ab6d8 commit 579bd30
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Monal/Classes/ContactDetails.swift
Original file line number Diff line number Diff line change
Expand Up @@ -388,15 +388,16 @@ struct ContactDetails: View {
let displayName = contact.contactDisplayName as String
let sharedUrl = HelperTools.getSharedDocumentsURL(forPathComponents:[accountJid, displayName])
if UIApplication.shared.canOpenURL(sharedUrl) && FileManager.default.fileExists(atPath:sharedUrl.path) {
NavigationLink(destination: LazyClosureView{MediaGalleryView(contact: contact.contactJid as String, accountID: contact.accountID)}) {
Text("View Media Gallery")
}

Button(action: {
UIApplication.shared.open(sharedUrl, options:[:])
}) {
Text("Show shared Media and Files")
}
}
NavigationLink(destination: LazyClosureView{MediaGalleryView(contact: contact.contactJid as String, accountID: contact.accountID)}) {
Text("View Media Gallery")
}

NavigationLink(destination: LazyClosureView(BackgroundSettings(contact:contact))) {
Text("Change Chat Background")
Expand Down

0 comments on commit 579bd30

Please sign in to comment.