TUM-Dev / gocast

TUMs lecture streaming service.
https://live.rbg.tum.de/
MIT License
177 stars 41 forks source link

Close button to exit user settings does not always navigate back to the home page automatically #1315

Closed barisgul15 closed 4 months ago

barisgul15 commented 5 months ago

Describe the bug When close button is clicked on settings, it navigates to the previous page. For example if my previous page was example.com, and I just type to my browser https://live.rbg.tum.de/settings, and then click the close button, I return to example.com, not https://live.rbg.tum.de.

To Reproduce Steps to reproduce the behavior:

  1. Go to any website except https://live.rbg.tum.de
  2. Go to https://live.rbg.tum.de/settings directly.
  3. Click the esc button.

Expected behavior What I expect is that close button should return to the https://live.rbg.tum.de automatically, probably nobody will ever visit the settings page directly, but still it can probably fixed with a one liner.

Additional context If I remember correctly, the esc button navigates directly to the previous page, just changing that to the https://live.rbg.tum.de should be enough.

barisgul15 commented 5 months ago

changing @click="history.back() to onclick="window.location.href='https://live.rbg.tum.de/' at close-btn.gohtml fixes this problem if this issue wanted to be fixed or it can stay as it is because probably nobody will ever enter the settings directly.

SebiWrn commented 5 months ago

But this would remove the functionality, that users can go back to their lecture, if they entered the settings from a lecture page. Shouldn't we keep that functionality?

barisgul15 commented 5 months ago

I did not consider this case while writing this issue, but you are right. Like I said I think it is a very low possibility that a user encounters this problem because even I have to copy the settings link, navigate to a whole different web page etc. to create this problem. That's why I am not sure this needs a fix or not. Maybe before navigating to history.back, we can check the previous url, if it has live.rbg.tum in it, then we can navigate back, else just navigate to the home page, but if you find this unnecessary, we can leave it as it is.

SebiWrn commented 5 months ago

Most browsers prevent us from getting the previous URL as this could be a security violation

YiranDuan721 commented 5 months ago

... it can stay as it is because probably nobody will ever enter the settings directly.

I'd say just keep it as it is. And if one ever wants to visit TUM-Live from the setting page directly, they can still get to the home page by clicking the logo in the upper-left corner :-D

SebiWrn commented 4 months ago

Ok then I'll close this issue :)