Skip to content

Don't add analysis view to stack if already in it.#580

Merged
Rigellute merged 1 commit into
Rigellute:masterfrom
ericonr:analysis
Sep 22, 2020
Merged

Don't add analysis view to stack if already in it.#580
Rigellute merged 1 commit into
Rigellute:masterfrom
ericonr:analysis

Conversation

@ericonr
Copy link
Copy Markdown
Contributor

@ericonr ericonr commented Sep 19, 2020

Before this commit, if a user pressed v multiple times, they would
have to press q the same number of times to get to the previous view.

This commit makes it so that an analysis view entry is only pushed into
the navigation stack if the current view isn't an analysis one.

Before this commit, if a user pressed `v` multiple times, they would
have to press `q` the same number of times to get to the previous view.

This commit makes it so that an analysis view entry is only pushed into
the navigation stack if the current view isn't an analysis one.
@ericonr
Copy link
Copy Markdown
Contributor Author

ericonr commented Sep 19, 2020

I think this might be an issue with most views, but it would be quite complex to add it for the others, such as album and artist ones. So I still think it makes sense to add it for this specific one.

Copy link
Copy Markdown
Owner

@Rigellute Rigellute left a comment

Choose a reason for hiding this comment

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

Nice one @ericonr - I think you're right to only fix this for audio analysis at the moment.

Thank you for your contribution.

@Rigellute Rigellute merged commit 6f8246b into Rigellute:master Sep 22, 2020
@Rigellute
Copy link
Copy Markdown
Owner

@all-contributors please add @ericonr for code

@allcontributors
Copy link
Copy Markdown
Contributor

@Rigellute

I've put up a pull request to add @ericonr! 🎉

@ericonr
Copy link
Copy Markdown
Contributor Author

ericonr commented Sep 22, 2020

@Rigellute I was thinking of checking if analysis was the current view in the function that pushes it into the stack, but to make that work we'd probably require a bigger design change. I am interested in trying to look into this to make it more generalized. Perhaps return an error from the function that pushes into the stack if the current view is the same? And use that as a conditional for the other actions?

lanej pushed a commit to lanej/spotify-tui that referenced this pull request Jul 13, 2021
Before this commit, if a user pressed `v` multiple times, they would
have to press `q` the same number of times to get to the previous view.

This commit makes it so that an analysis view entry is only pushed into
the navigation stack if the current view isn't an analysis one.
nighi pushed a commit to nighi/spotify-tui that referenced this pull request Jul 11, 2025
Before this commit, if a user pressed `v` multiple times, they would
have to press `q` the same number of times to get to the previous view.

This commit makes it so that an analysis view entry is only pushed into
the navigation stack if the current view isn't an analysis one.
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.

2 participants