fix: streamline AI retouch submission feedback
This commit is contained in:
@@ -25,6 +25,7 @@ final class TravelAlbumPhotoPreviewViewController: UIViewController {
|
||||
private let loadMore: TravelAlbumPreviewLoadMore?
|
||||
private let reload: TravelAlbumPreviewReload?
|
||||
private let onProjectDeleted: ((Int) -> Void)?
|
||||
private let onAIRetouchSubmitted: (() -> Void)?
|
||||
private let allowsActions: Bool
|
||||
private var nodes: [TravelAlbumPreviewNode] = []
|
||||
private var currentNodeIndex = 0
|
||||
@@ -73,7 +74,8 @@ final class TravelAlbumPhotoPreviewViewController: UIViewController {
|
||||
aiRetouchAPI: (any TravelAlbumServing)? = nil,
|
||||
loadMore: TravelAlbumPreviewLoadMore? = nil,
|
||||
reload: TravelAlbumPreviewReload? = nil,
|
||||
onProjectDeleted: ((Int) -> Void)? = nil
|
||||
onProjectDeleted: ((Int) -> Void)? = nil,
|
||||
onAIRetouchSubmitted: (() -> Void)? = nil
|
||||
) {
|
||||
self.projects = Self.deduplicated(projects)
|
||||
self.totalCount = max(totalCount, projects.count)
|
||||
@@ -85,6 +87,7 @@ final class TravelAlbumPhotoPreviewViewController: UIViewController {
|
||||
self.loadMore = loadMore
|
||||
self.reload = reload
|
||||
self.onProjectDeleted = onProjectDeleted
|
||||
self.onAIRetouchSubmitted = onAIRetouchSubmitted
|
||||
self.allowsActions = allowsActions
|
||||
super.init(nibName: nil, bundle: nil)
|
||||
modalPresentationStyle = .fullScreen
|
||||
@@ -726,34 +729,14 @@ final class TravelAlbumPhotoPreviewViewController: UIViewController {
|
||||
workflow: workflow
|
||||
),
|
||||
api: aiRetouchAPI,
|
||||
onSubmitted: { [weak self] submission in
|
||||
onSubmitted: { [weak self] _ in
|
||||
guard let self else { return }
|
||||
self.reloadProjects(showGlobalLoading: false, forceRefreshImage: false)
|
||||
self.presentAIRetouchSubmitted(submission)
|
||||
self.dismiss(animated: true) { self.onAIRetouchSubmitted?() }
|
||||
}
|
||||
)
|
||||
present(controller, animated: true)
|
||||
}
|
||||
|
||||
private func presentAIRetouchSubmitted(_ submission: TravelAlbumAIJobSubmission) {
|
||||
let alert = UIAlertController(
|
||||
title: "AI修图任务已提交",
|
||||
message: "完成后将通过消息通知。",
|
||||
preferredStyle: .alert
|
||||
)
|
||||
alert.addAction(UIAlertAction(title: "知道了", style: .cancel))
|
||||
alert.addAction(UIAlertAction(title: "查看任务", style: .default) { [weak self] _ in
|
||||
guard let self, let navigationController = presentingViewController?.navigationController else { return }
|
||||
dismiss(animated: true) {
|
||||
navigationController.pushViewController(
|
||||
TravelAlbumAIJobDetailViewController(batchId: submission.aiRetouchBatchId),
|
||||
animated: true
|
||||
)
|
||||
}
|
||||
})
|
||||
present(alert, animated: true)
|
||||
}
|
||||
|
||||
@objc private func deleteTapped() {
|
||||
guard currentProject != nil, !isDeletingProject else { return }
|
||||
let alert = UIAlertController(
|
||||
|
||||
Reference in New Issue
Block a user