feat: update app workflows and permissions
This commit is contained in:
@ -207,8 +207,8 @@ final class HomeViewController: BaseViewController {
|
||||
)
|
||||
}
|
||||
cell.cardView.onSubmitTask = { [weak self] in
|
||||
self?.navigationController?.pushViewController(TaskAddViewController(), animated: true)
|
||||
}
|
||||
self?.navigationController?.pushViewController(TaskAddViewController(), animated: true)
|
||||
}
|
||||
cell.cardView.onToggleOnline = { [weak self] in
|
||||
self?.viewModel.showOnlineStatusSwitchDialog()
|
||||
}
|
||||
@ -301,10 +301,17 @@ final class HomeViewController: BaseViewController {
|
||||
storeItem: viewModel.storeItem,
|
||||
commonMenus: viewModel.commonMenus
|
||||
)
|
||||
dataSource.apply(snapshot, animatingDifferences: false)
|
||||
dataSource.apply(snapshot, animatingDifferences: false) { [weak self] in
|
||||
self?.refreshStatusVisibleCells()
|
||||
}
|
||||
presentDialogsIfNeeded()
|
||||
}
|
||||
|
||||
private func refreshStatusVisibleCells() {
|
||||
refreshWorkStatusVisibleCell()
|
||||
refreshQuickActionsVisibleCell()
|
||||
}
|
||||
|
||||
private func refreshWorkStatusVisibleCell() {
|
||||
guard !viewModel.isMinimalTopRole,
|
||||
let sectionIndex = currentSections.firstIndex(of: .workStatus) else {
|
||||
@ -321,6 +328,18 @@ final class HomeViewController: BaseViewController {
|
||||
)
|
||||
}
|
||||
|
||||
private func refreshQuickActionsVisibleCell() {
|
||||
guard !viewModel.isMinimalTopRole,
|
||||
let sectionIndex = currentSections.firstIndex(of: .quickActions) else {
|
||||
return
|
||||
}
|
||||
let indexPath = IndexPath(item: 0, section: sectionIndex)
|
||||
guard let cell = collectionView.cellForItem(at: indexPath) as? HomeQuickActionsCell else {
|
||||
return
|
||||
}
|
||||
cell.apply(isOnline: viewModel.isOnline)
|
||||
}
|
||||
|
||||
private func presentDialogsIfNeeded() {
|
||||
if viewModel.showPermissionDialog {
|
||||
presentDialog(.permission)
|
||||
|
||||
Reference in New Issue
Block a user