[Feature Request]: Hide IV related options when IV API isnt set as primary/fallback
Guidelines
- [x] I have searched the issue tracker for open and closed issues that are similar to the feature request I want to file, without success.
- [x] I have searched the documentation for information that matches the description of the feature request I want to file, without success.
- [x] This issue contains only one feature request.
Problem Description
When Primary API is set to Local and fallback is disabled we can safely assume that the user doesnt want to use the IV API. While we do hide some elements under these conditions others are still being displayed.
Proposed Solution
Example of elements where we could hide IV related options
Alternatives Considered
None.
Issue Labels
visual improvement
Additional Information
No response
I've taken a quick look at this and it's simple for any Vue components, but hit a bit of a roadblock with links inside the context menu.
Since the electron-context-menu is only called once, my idea was to de-couple the context menu from the main app index.js and have it re-initialize (with appropriate params) every time the Invidious backend is toggled inside the settings. I wanted to check if this would be the preferred way to implement this or if anyone else has some other ideas?
@ozrendev Great to hear you are interested in looking into this! While yes we do call the initialise function once, we actually register prepend and append callbacks that are called every time the context menu is triggered, which is how we customise the Copy Link options.
As those callbacks are synchronous and reading from the databases is an asynchronous operation, my suggestion would be to instead read the two relevant settings once at start-up (you can take inspiration for how we handle the proxy settings), store them in variables that can be used in those callbacks and update the variables when the settings change (you can take inspiration for how we handle updating the app menu).
If you need any more specific guidance feel free to reach out.
@absidue Thanks for the detailed reply, it really helped a lot! I've created the relevant pull request #7572
It covers the scenarios in the original issue and I couldn't find any other places where it was necessary.