Skip to content

Commit

Permalink
fix: Enforce unsetting openfile when the viewer is closed
Browse files Browse the repository at this point in the history
Signed-off-by: Louis Chemineau <louis@chmn.me>
  • Loading branch information
artonge authored and backportbot[bot] committed Jul 17, 2024
1 parent a01a8ff commit 35ca6a7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/services/FilesActionHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ export default function(node, view, dir) {
{ ...window.OCP.Files.Router.query },
true,
]
const onClose = () => window.OCP.Files.Router.goToRoute(...oldRoute)
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)
}
pushToHistory(node, view, dir)
OCA.Viewer.open({ path, onPrev: pushToHistory, onNext: pushToHistory, onClose })
}
Expand Down

0 comments on commit 35ca6a7

Please sign in to comment.