Skip to content

Commit

Permalink
Merge pull request #2540 from nextcloud/backport/2539/stable28
Browse files Browse the repository at this point in the history
  • Loading branch information
skjnldsv authored Sep 20, 2024
2 parents 2a5bd07 + c2f0cd8 commit 796114c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
4 changes: 2 additions & 2 deletions js/viewer-main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/viewer-main.js.map

Large diffs are not rendered by default.

11 changes: 3 additions & 8 deletions src/services/FilesActionHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,11 @@
export default function(node, view, dir) {
// replace potential leading double slashes
const path = `${node.dirname}/${node.basename}`.replace(/^\/\//, '/')
const oldRoute = [
window.OCP.Files.Router.name,
{ ...window.OCP.Files.Router.params },
{ ...window.OCP.Files.Router.query },
true,
]
const onClose = () => {
// This can sometime be called with the openfile set to true already. But we don't want to keep openfile when closing the viewer.
delete oldRoute[2].openfile
window.OCP.Files.Router.goToRoute(...oldRoute)
const newQuery = { ...window.OCP.Files.Router.query }
delete newQuery.openfile
window.OCP.Files.Router.goToRoute(null, window.OCP.Files.Router.params, newQuery)
}
pushToHistory(node, view, dir)
OCA.Viewer.open({ path, onPrev: pushToHistory, onNext: pushToHistory, onClose })
Expand Down

0 comments on commit 796114c

Please sign in to comment.