Skip to content

Commit

Permalink
fix(PreviewViewController): Disable edit button in public share mode (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeWeidmann authored Jan 24, 2025
2 parents 589d089 + b0f2ab3 commit f4e459c
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ final class PreviewViewController: UIViewController, PreviewContentCellDelegate,
}
}

private var editButtonHidden: Bool {
driveFileManager.isPublicShare
}

private var currentDownloadOperation: DownloadAuthenticatedOperation?
private let pdfPageLabel = UILabel(frame: .zero)
private var titleWidthConstraint: NSLayoutConstraint?
Expand Down Expand Up @@ -344,7 +348,7 @@ final class PreviewViewController: UIViewController, PreviewContentCellDelegate,
private func setNavbarForEditing() {
backButton.isHidden = false
pdfPageLabel.isHidden = true
editButton.isHidden = false
editButton.isHidden = editButtonHidden
openButton.isHidden = true
}

Expand Down Expand Up @@ -372,6 +376,7 @@ final class PreviewViewController: UIViewController, PreviewContentCellDelegate,
}

@objc private func editFile() {
guard !driveFileManager.isPublicShare else { return }
MatomoUtils.track(eventWithCategory: .mediaPlayer, name: "edit")
floatingPanelViewController.dismiss(animated: true)
OnlyOfficeViewController.open(driveFileManager: driveFileManager, file: currentFile, viewController: self)
Expand Down

0 comments on commit f4e459c

Please sign in to comment.