Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Use new viewer syntax with destructuring object
With nextcloud/viewer#936 and Nextcloud 22 the old syntax will not be supported anymore.

Signed-off-by: Azul <[email protected]>
  • Loading branch information
azul committed Jun 5, 2021
commit 70fd12310f156316a6d08399873da1481c9d44ab
4 changes: 2 additions & 2 deletions src/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@ const NewFilePlugin = {
const isPublic = document.getElementById('isPublic') ? document.getElementById('isPublic').value === '1' : false
if (isPublic) {
return window.FileList.createFile(filename).then(function() {
OCA.Viewer.open(path)
OCA.Viewer.open({ path })
})
}

axios.post(OC.generateUrl('apps/officeonline/ajax/documents/create'), { mimetype, filename, dir }).then(({ data }) => {
console.debug(data)
if (data && data.status === 'success') {
window.FileList.add(data.data, { animate: true, scrollTo: true })
window.OCA.Viewer.open(path)
window.OCA.Viewer.open({ path })
} else {
window.OC.dialogs.alert(data.data.message, t('core', 'Could not create file'))
}
Expand Down