Skip to content

Commit

Permalink
Merge pull request #425 from PermanentOrg/bugfix/VSP-1387-Profile-pho…
Browse files Browse the repository at this point in the history
…to-issue

VSP-1387[IOS] Archive profile photo and banner can't be changed
  • Loading branch information
luciancerbu-vsp authored Mar 15, 2024
2 parents 3adb335 + 3499171 commit 68f95dc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion Permanent/Common/Files/ViewModel/MyFilesViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ protocol MyFilesViewModelPickerDelegate: AnyObject {
class MyFilesViewModel: FilesViewModel {
static let didSelectFilesNotifName = NSNotification.Name("MyFilesViewModel.didSelectFilesNotifName")
var isPickingImage: Bool = false
var isPickingProfilePicture: Bool = false
weak var pickerDelegate: MyFilesViewModelPickerDelegate?

override var currentFolderIsRoot: Bool { navigationStack.count == 1 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class MainViewController: BaseViewController<MyFilesViewModel> {
overlayView.backgroundColor = .overlay
overlayView.alpha = 0

fabView.isHidden = viewModel!.archivePermissions.contains(.create) == false || viewModel!.archivePermissions.contains(.upload) == false || viewModel!.isPickingImage || viewModel!.isPickingProfilePicture
fabView.isHidden = viewModel!.archivePermissions.contains(.create) == false || viewModel!.archivePermissions.contains(.upload) == false || viewModel!.isPickingImage
}

fileprivate func setupCollectionView() {
Expand Down Expand Up @@ -888,7 +888,7 @@ extension MainViewController: UICollectionViewDelegateFlowLayout, UICollectionVi

let headerView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: FileCollectionViewHeaderCell.identifier, for: indexPath) as! FileCollectionViewHeaderCell
headerView.leftButtonTitle = viewModel?.title(forSection: section)
headerView.configure(with: viewModel, isPickingProfilePicture: viewModel!.isPickingProfilePicture)
headerView.configure(with: viewModel, isPickingProfilePicture: viewModel!.isPickingImage)
if viewModel?.shouldPerformAction(forSection: section) == true {
headerView.leftButtonAction = { [weak self] header in self?.headerButtonAction(UIButton()) }
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class PublicArchiveViewController: BaseViewController<PublicProfilePicturesViewM

let myFilesVC = UIViewController.create(withIdentifier: .main, from: .main) as! MainViewController
let myFilesVM = MyFilesViewModel()
myFilesVM.isPickingProfilePicture = true
myFilesVM.isPickingImage = true
myFilesVM.pickerDelegate = self
myFilesVC.viewModel = myFilesVM

Expand All @@ -192,7 +192,7 @@ class PublicArchiveViewController: BaseViewController<PublicProfilePicturesViewM

let myFilesVC = UIViewController.create(withIdentifier: .main, from: .main) as! MainViewController
let myFilesVM = MyFilesViewModel()
myFilesVM.isPickingProfilePicture = true
myFilesVM.isPickingImage = true
myFilesVM.pickerDelegate = self
myFilesVC.viewModel = myFilesVM

Expand Down

0 comments on commit 68f95dc

Please sign in to comment.