Skip to content

Commit

Permalink
Specify path on NC24 for viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
pulsejet committed Oct 29, 2022
1 parent 705cb4f commit c50c541
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/services/Viewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,14 @@ export class ViewerManager {
return;
}

// Check viewer > 2.0.0
const viewerVersion: string = globalThis.OCA.Viewer.version;
const viewerMajor = Number(viewerVersion.split(".")[0]);

// Open Nextcloud viewer
globalThis.OCA.Viewer.open({
fileInfo: fInfo,
path: viewerMajor < 2 ? fInfo.filename : undefined, // Only specify path upto Nextcloud 24
list: fileInfos, // file list
canLoop: false, // don't loop
onClose: () => {
Expand Down

0 comments on commit c50c541

Please sign in to comment.