Describe the bug
When matrix.to is open, putting #/policy/ in the URL is a no-op. However, when the page is refreshed, the policy does again appear. When doing so, however, even if you change the URL to something else, the policy information remains and looks quite broken.
To Reproduce
Steps to reproduce the behavior:
Go to any Matrix.to link (say, /#/@daniel:matrix.danilafe.com)
Change URL to /#/policy/.
Nothing happens (issue 1)
Refresh page. Policy information appears
Navigate back to /#/@daniel:matrix.danilafe.com
Policy information remains (issue 2, see attached screenshot)
Expected behavior
Display policy whenever in /policy, and not at other times.
Screenshots
Desktop (please complete the following information):
Describe the bug When
matrix.to
is open, putting#/policy/
in the URL is a no-op. However, when the page is refreshed, the policy does again appear. When doing so, however, even if you change the URL to something else, the policy information remains and looks quite broken.To Reproduce Steps to reproduce the behavior:
/#/@daniel:matrix.danilafe.com
)/#/policy/
./#/@daniel:matrix.danilafe.com
Expected behavior Display policy whenever in
/policy
, and not at other times.Screenshots![Screenshot 2021-08-25 at 14-07-27 You're invited to talk on Matrix](https://user-images.githubusercontent.com/4361282/130865098-5b34586f-7440-4a44-bb0f-c0df16d55706.png)
Desktop (please complete the following information):
Additional context Issue 1 seems to be caused by the following: https://github.com/matrix-org/matrix.to/blob/c25a9dae4d430a4379394637dd1e1d74208c52ce/src/RootViewModel.js#L53-L63 Specifically line 57, where a view model is added, but no event is emitted (and the view doesn't know to update).
Issue 2 stems from the fact that changing the URL to non-policy does not reset the existing policy view.
If this is indeed correct, I can submit a PR with a fix.