Skip to content

Commit

Permalink
IOS-2125 Allow create object from permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
mgolovko committed Mar 27, 2024
1 parent a793a7f commit cd9d777
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ final class ObjectWidgetInternalViewModel: WidgetInternalViewModelProtocol {

var detailsPublisher: AnyPublisher<[ObjectDetails]?, Never> { $details.eraseToAnyPublisher() }
var namePublisher: AnyPublisher<String, Never> { $name.eraseToAnyPublisher() }
var allowCreateObject = true
@Published var allowCreateObject = true

init(
widgetBlockId: String,
Expand All @@ -50,6 +50,8 @@ final class ObjectWidgetInternalViewModel: WidgetInternalViewModelProtocol {
.receiveOnMain()
.sink { [weak self] details in
self?.name = details.title
self?.allowCreateObject = details.permissions(participantCanEdit: true).canEditBlocks

self?.linkedObjectDetails = details
Task { await self?.updateLinksSubscriptions() }
}
Expand Down

0 comments on commit cd9d777

Please sign in to comment.