Skip to content

Commit

Permalink
Delete vs Save flip
Browse files Browse the repository at this point in the history
  • Loading branch information
JPKribs committed Jan 7, 2025
1 parent 57fc825 commit 710e9a6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions Shared/Coordinators/ItemImagesCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ final class ItemImagesCoordinator: ObservableObject, NavigationCoordinatable {
index: imageInfo.imageIndex,
width: imageInfo.width,
height: imageInfo.height,
isLocal: false, onDelete: {
isLocal: true,
onDelete: {
self.viewModel.send(.deleteImage(imageInfo))
}
)
Expand All @@ -80,7 +81,8 @@ final class ItemImagesCoordinator: ObservableObject, NavigationCoordinatable {
rating: remoteImageInfo.communityRating,
ratingType: remoteImageInfo.ratingType,
ratingVotes: remoteImageInfo.voteCount,
isLocal: false, onSave: {
isLocal: false,
onSave: {
self.viewModel.send(.setImage(remoteImageInfo))
}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,13 @@ struct ItemImageDetailsView: View {
)

DeleteButton {
if !isLocal, let onDelete {
if isLocal, let onDelete {
onDelete()
}
}
}
.topBarTrailing {
if isLocal, let onSave {
if !isLocal, let onSave {
Button(L10n.save, action: onSave)
.buttonStyle(.toolbarPill)
}
Expand Down

0 comments on commit 710e9a6

Please sign in to comment.