-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
feat: Reset route if neither the Viewer of the Sidebar is open #47920
feat: Reset route if neither the Viewer of the Sidebar is open #47920
Conversation
0bc7e5e
to
87927e5
Compare
9998b21
to
fc91cf3
Compare
// If the Sidebar is closed and if openFile is false, remove the file id from the URL | ||
if (OCA.Files.Sidebar.file === '') { | ||
window.OCP.Files.Router.goToRoute( | ||
null, | ||
{ ...this.$route.params, fileid: undefined }, | ||
this.$route.query, | ||
) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not exactly a Viewer close event, but does the job.
fc91cf3
to
1800d87
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense (ideally add a cypress tests), only thing I am not sure about if this really should be inside the virtual file list. But code makes sense and seems to work fine.
1800d87
to
11ff3d0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait for it
11ff3d0
to
bb2d8e1
Compare
When the viewer or the sidebar is opened, we add the fileid to the route. When both of them are closed, we do not remove the fileid from the route. This means that, upon reload, the sidebar will be opened even though it was closed previously. This PR ensure that the fileid is removed from the route when both the Sidebar and the Viewer are closed. Signed-off-by: Louis Chemineau <louis@chmn.me>
bb2d8e1
to
2da1c57
Compare
Backports ? |
/backport to stable30 |
/backport to stable29 |
/backport to stable28 |
When the viewer or the sidebar is opened, we add the fileid to the route.
When both of them are closed, we do not remove the fileid from the route.
This means that, upon reload, the sidebar will be opened even though it was closed previously.
This PR ensure that the fileid is removed from the route when both the Sidebar and the Viewer are closed.
Screencast.from.2024-09-12.15-38-42.mp4