Skip to content

Commit

Permalink
Use new viewer syntax with destructuring object
Browse files Browse the repository at this point in the history
With nextcloud/viewer#936 and Nextcloud 22 the old syntax will not be supported anymore.

Signed-off-by: Azul <azul@riseup.net>
  • Loading branch information
azul committed Jun 5, 2021
1 parent 76f30ee commit 70fd123
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit 70fd123

Please sign in to comment.