Minor cleanup (#1138)
This commit is contained in:
parent
f9ae531b48
commit
3e200a7703
|
@ -284,8 +284,7 @@ extension ComposeViewController {
|
||||||
authContext: viewModel.authContext,
|
authContext: viewModel.authContext,
|
||||||
input: .image(image),
|
input: .image(image),
|
||||||
sizeLimit: composeContentViewModel.sizeLimit,
|
sizeLimit: composeContentViewModel.sizeLimit,
|
||||||
delegate: composeContentViewModel,
|
delegate: composeContentViewModel
|
||||||
caption: nil
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
composeContentViewModel.attachmentViewModels += attachmentViewModels
|
composeContentViewModel.attachmentViewModels += attachmentViewModels
|
||||||
|
|
|
@ -45,7 +45,6 @@ final public class AttachmentViewModel: NSObject, ObservableObject, Identifiable
|
||||||
public let authContext: AuthContext
|
public let authContext: AuthContext
|
||||||
public let input: Input
|
public let input: Input
|
||||||
public let sizeLimit: SizeLimit
|
public let sizeLimit: SizeLimit
|
||||||
let originalCaption: String?
|
|
||||||
@Published var caption = ""
|
@Published var caption = ""
|
||||||
@Published public private(set) var isCaptionEditable = true
|
@Published public private(set) var isCaptionEditable = true
|
||||||
let isEditing: Bool
|
let isEditing: Bool
|
||||||
|
@ -79,7 +78,7 @@ final public class AttachmentViewModel: NSObject, ObservableObject, Identifiable
|
||||||
sizeLimit: SizeLimit,
|
sizeLimit: SizeLimit,
|
||||||
delegate: AttachmentViewModelDelegate,
|
delegate: AttachmentViewModelDelegate,
|
||||||
isEditing: Bool = false,
|
isEditing: Bool = false,
|
||||||
caption: String?
|
caption: String? = nil
|
||||||
) {
|
) {
|
||||||
self.api = api
|
self.api = api
|
||||||
self.authContext = authContext
|
self.authContext = authContext
|
||||||
|
@ -88,7 +87,6 @@ final public class AttachmentViewModel: NSObject, ObservableObject, Identifiable
|
||||||
self.delegate = delegate
|
self.delegate = delegate
|
||||||
self.isEditing = isEditing
|
self.isEditing = isEditing
|
||||||
|
|
||||||
self.originalCaption = caption
|
|
||||||
self.caption = caption ?? ""
|
self.caption = caption ?? ""
|
||||||
|
|
||||||
super.init()
|
super.init()
|
||||||
|
|
|
@ -473,8 +473,7 @@ extension ComposeContentViewController: PHPickerViewControllerDelegate {
|
||||||
authContext: viewModel.authContext,
|
authContext: viewModel.authContext,
|
||||||
input: .pickerResult(result),
|
input: .pickerResult(result),
|
||||||
sizeLimit: viewModel.sizeLimit,
|
sizeLimit: viewModel.sizeLimit,
|
||||||
delegate: viewModel,
|
delegate: viewModel
|
||||||
caption: nil
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
viewModel.attachmentViewModels += attachmentViewModels
|
viewModel.attachmentViewModels += attachmentViewModels
|
||||||
|
@ -493,8 +492,7 @@ extension ComposeContentViewController: UIImagePickerControllerDelegate & UINavi
|
||||||
authContext: viewModel.authContext,
|
authContext: viewModel.authContext,
|
||||||
input: .image(image),
|
input: .image(image),
|
||||||
sizeLimit: viewModel.sizeLimit,
|
sizeLimit: viewModel.sizeLimit,
|
||||||
delegate: viewModel,
|
delegate: viewModel
|
||||||
caption: nil
|
|
||||||
)
|
)
|
||||||
viewModel.attachmentViewModels += [attachmentViewModel]
|
viewModel.attachmentViewModels += [attachmentViewModel]
|
||||||
}
|
}
|
||||||
|
@ -514,8 +512,7 @@ extension ComposeContentViewController: UIDocumentPickerDelegate {
|
||||||
authContext: viewModel.authContext,
|
authContext: viewModel.authContext,
|
||||||
input: .url(url),
|
input: .url(url),
|
||||||
sizeLimit: viewModel.sizeLimit,
|
sizeLimit: viewModel.sizeLimit,
|
||||||
delegate: viewModel,
|
delegate: viewModel
|
||||||
caption: nil
|
|
||||||
)
|
)
|
||||||
viewModel.attachmentViewModels += [attachmentViewModel]
|
viewModel.attachmentViewModels += [attachmentViewModel]
|
||||||
}
|
}
|
||||||
|
|
|
@ -260,8 +260,7 @@ extension ShareViewController {
|
||||||
authContext: authContext,
|
authContext: authContext,
|
||||||
input: .itemProvider(movieProvider),
|
input: .itemProvider(movieProvider),
|
||||||
sizeLimit: .init(image: nil, video: nil),
|
sizeLimit: .init(image: nil, video: nil),
|
||||||
delegate: composeContentViewModel,
|
delegate: composeContentViewModel
|
||||||
caption: nil
|
|
||||||
)
|
)
|
||||||
composeContentViewModel.attachmentViewModels.append(attachmentViewModel)
|
composeContentViewModel.attachmentViewModels.append(attachmentViewModel)
|
||||||
} else if !imageProviders.isEmpty {
|
} else if !imageProviders.isEmpty {
|
||||||
|
@ -271,8 +270,7 @@ extension ShareViewController {
|
||||||
authContext: authContext,
|
authContext: authContext,
|
||||||
input: .itemProvider(provider),
|
input: .itemProvider(provider),
|
||||||
sizeLimit: .init(image: nil, video: nil),
|
sizeLimit: .init(image: nil, video: nil),
|
||||||
delegate: composeContentViewModel,
|
delegate: composeContentViewModel
|
||||||
caption: nil
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
composeContentViewModel.attachmentViewModels.append(contentsOf: attachmentViewModels)
|
composeContentViewModel.attachmentViewModels.append(contentsOf: attachmentViewModels)
|
||||||
|
|
Loading…
Reference in New Issue