Skip to content

Commit 25c5380

Browse files
artongebackportbot[bot]
authored andcommitted
fix: Only remove openfile from route when closing the viewer
Signed-off-by: Louis Chemineau <louis@chmn.me>
1 parent d5aeef5 commit 25c5380

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

src/services/FilesActionHandler.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,11 @@
2828
export default function(node, view, dir) {
2929
// replace potential leading double slashes
3030
const path = `${node.dirname}/${node.basename}`.replace(/^\/\//, '/')
31-
const oldRoute = [
32-
window.OCP.Files.Router.name,
33-
{ ...window.OCP.Files.Router.params },
34-
{ ...window.OCP.Files.Router.query },
35-
true,
36-
]
3731
const onClose = () => {
3832
// This can sometime be called with the openfile set to true already. But we don't want to keep openfile when closing the viewer.
39-
delete oldRoute[2].openfile
40-
window.OCP.Files.Router.goToRoute(...oldRoute)
33+
const newQuery = { ...window.OCP.Files.Router.query }
34+
delete newQuery.openfile
35+
window.OCP.Files.Router.goToRoute(null, window.OCP.Files.Router.params, newQuery)
4136
}
4237
pushToHistory(node, view, dir)
4338
OCA.Viewer.open({ path, onPrev: pushToHistory, onNext: pushToHistory, onClose })

0 commit comments

Comments
 (0)