Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed problematic toast (was not specified in Figma for this view) #657

Merged
merged 4 commits into from
Aug 21, 2024

Conversation

charles-b-stb
Copy link
Contributor

Issue

Overview (Required)

  • Toast message removed from timetable list view. The toast conflicted with the floating tab bar and was not specified in Figma (unlike the detail view) so it was removed to match spec.

Links

Screenshot (Optional if screenshot test is present or unrelated to UI)

Before After

Movie (Optional)

Before After

@shin-usu
Copy link
Contributor

shin-usu commented Aug 19, 2024

Probably, you can remove toast value from state.
Also, AddFavorite string can be remove from string catalog, I think.

@charles-b-stb
Copy link
Contributor Author

@shin-usu Fixed as suggested. Thanks!

@shin-usu
Copy link
Contributor

shin-usu commented Aug 20, 2024

It seems like build error is occurring 👀
I think toast modifier also can be removed.

@charles-b-stb
Copy link
Contributor Author

@shin-usu Sorry about that. This should fix that build issue. Tested again locally and it seems to be fine.

Copy link
Contributor

@shin-usu shin-usu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@charles-b-stb
Thank you for your commit!
I left some comments. Please check and response🙏🏻

@@ -103,7 +103,7 @@ public struct TimetableReducer : Sendable{
return item.isFavorited
}))
}
case let .favoriteResponse(.success(isFavorited)):
case .favoriteResponse(.success(_)):
Copy link
Contributor

@shin-usu shin-usu Aug 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If isFavorited is unnecessary, favoriteResponse case's type should be modified.
For example.

public enum Action : Sendable, BindableAction {
...
    case favoriteResponse(Result<Void, any Error>)
...
}

switch action {
...
case .favoriteResponse(.success):
    return .none
...
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

state.toast = .init(text: String(localized: "AddFavorite", bundle: .module))
}
case .favoriteResponse(.success(_)):
//No response here on purpose. Toasts look bad here.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this comment is unnecessary since toast does not exist in Reducer and View anymore.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Copy link
Contributor

@shin-usu shin-usu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM🎉🎉 Thanks!!

@charles-b-stb charles-b-stb merged commit 1a5181c into main Aug 21, 2024
7 checks passed
@charles-b-stb charles-b-stb deleted the feature/617-favoriteBugFix branch August 21, 2024 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Timetable Feature: Fix an action of tapped favorite button
2 participants