Fix triggering favorite file actions on the file list

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ (skjnldsv) 2019-10-23 11:41:47 +02:00 committed by Daniel Calviño Sánchez
parent 12eba18bdf
commit 51960cb228
1 changed files with 7 additions and 0 deletions

View File

@ -315,6 +315,13 @@ export default {
${state ? '</d:set>' : '</d:remove>'}
</d:propertyupdate>`
})
// TODO: Obliterate as soon as possible and use events with new files app
// Terrible fallback for legacy files: toggle filelist as well
if (OCA.Files && OCA.Files.App && OCA.Files.App.fileList && OCA.Files.App.fileList.fileActions) {
OCA.Files.App.fileList.fileActions.triggerAction('Favorite', OCA.Files.App.fileList.getModelForFile(this.fileInfo.name), OCA.Files.App.fileList)
}
} catch (error) {
OC.Notification.showTemporary(t('files', 'Unable to change the favourite state of the file'))
console.error('Unable to change favourite state', error)