Skip to content

Commit eacf38d

Browse files
committed
fix: Usage of pushToHistory function on prev/next
Signed-off-by: Louis Chemineau <louis@chmn.me>
1 parent 77c8e49 commit eacf38d

File tree

10 files changed

+47
-11
lines changed

10 files changed

+47
-11
lines changed

css/main--fK07A8K.chunk.css

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/main-DA7qfHYK.chunk.css

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/main-DnH6w7F4.chunk.css

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/viewer-main.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
/* extracted by css-entry-points-plugin */
2-
@import './main--fK07A8K.chunk.css';
2+
@import './main-DnH6w7F4.chunk.css';
33
@import './logger-B5Yp6f8I.chunk.css';

js/viewer-init.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

js/viewer-init.mjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/viewer-main.mjs

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

js/viewer-main.mjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/services/FilesActionHandler.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,16 @@ function filesActionHandler(node, view, dir) {
4040
window.OCP.Files.Router.goToRoute(null, window.OCP.Files.Router.params, newQuery)
4141
}
4242
pushToHistory(node, view, dir)
43-
OCA.Viewer.open({ path, onPrev: pushToHistory, onNext: pushToHistory, onClose })
43+
window.OCA.Viewer.open({
44+
path,
45+
onPrev(fileInfo) {
46+
pushToHistory(fileInfo, view, dir)
47+
},
48+
onNext(fileInfo) {
49+
pushToHistory(fileInfo, view, dir)
50+
},
51+
onClose,
52+
})
4453
}
4554

4655
/**

src/views/Viewer.vue

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,31 +1017,30 @@ export default {
10171017
* Open previous available file
10181018
*/
10191019
previous() {
1020-
const oldFileInfo = this.fileList[this.currentIndex]
10211020
this.currentIndex--
10221021
if (this.currentIndex < 0) {
10231022
this.currentIndex = this.fileList.length - 1
10241023
}
10251024
10261025
const fileInfo = this.fileList[this.currentIndex]
10271026
this.openFileFromList(fileInfo)
1028-
this.Viewer.onPrev(fileInfo, oldFileInfo)
1027+
this.Viewer.onPrev(fileInfo)
10291028
this.updateTitle(this.currentFile.basename)
10301029
},
10311030
10321031
/**
10331032
* Open next available file
10341033
*/
10351034
next() {
1036-
const oldFileInfo = this.fileList[this.currentIndex]
10371035
this.currentIndex++
10381036
if (this.currentIndex > this.fileList.length - 1) {
10391037
this.currentIndex = 0
10401038
}
10411039
10421040
const fileInfo = this.fileList[this.currentIndex]
10431041
this.openFileFromList(fileInfo)
1044-
this.Viewer.onNext(fileInfo, oldFileInfo)
1042+
this.Viewer.onNext(fileInfo)
1043+
10451044
this.updateTitle(this.currentFile.basename)
10461045
},
10471046

0 commit comments

Comments
 (0)