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

Disable hashtag navigation for avoiding redundant fetching #2083

Closed
wants to merge 3 commits into from

Conversation

juanyepesp
Copy link

I noticed that you can navigate to the same hashtag that you are currently at, which ultimately can lead to memory bloating and, if done too many times, can freeze or crash the app. To better understand the situation I am referring to, check the linked issue.

This hopefully fixes the issue, modifying the Router file inside the Env package. These modifications disable navigation from the same destination you are currently at, it can be either hashtags (case-insensitively), user profiles, etc. Hopefully I am not introducing any bugs or performance issues!

@@ -134,13 +135,25 @@ public enum SettingsStartingPoint {

public var path: [RouterDestination] = []
public var presentedSheet: SheetDestination?
public var currentDestination: RouterDestination?
Copy link
Owner

Choose a reason for hiding this comment

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

You don't need that path.last will give you exactly what you need.

@Dimillian Dimillian closed this Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Redundant fetching for hashtag navigation
2 participants