mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-21 20:45:51 +03:00
Add "createMode" toggle to share options view, start building for use to create new shares
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
0ceb6a9481
commit
e1997bd1fd
1 changed files with 14 additions and 0 deletions
|
@ -25,12 +25,26 @@ class ShareOptionsView: NSView {
|
|||
var dataSource: ShareTableViewDataSource?
|
||||
var controller: ShareController? {
|
||||
didSet {
|
||||
guard controller != nil else { return }
|
||||
cancellable?.cancel()
|
||||
createMode = false
|
||||
update()
|
||||
cancellable = controller.publisher.sink { _ in self.update() }
|
||||
}
|
||||
}
|
||||
var createMode = false {
|
||||
didSet {
|
||||
Logger.shareOptionsView.info("Create mode set: \(self.createMode)")
|
||||
shareTypePicker.isHidden = !createMode
|
||||
labelTextField.isHidden = createMode // Cannot set label on create API call
|
||||
guard createMode else { return }
|
||||
cancellable?.cancel()
|
||||
cancellable = nil
|
||||
controller = nil
|
||||
reset()
|
||||
setAllFields(enabled: true)
|
||||
}
|
||||
}
|
||||
private var cancellable: AnyCancellable?
|
||||
|
||||
private func update() {
|
||||
|
|
Loading…
Reference in a new issue