]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix triggering favorite file actions on the file list
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Wed, 23 Oct 2019 09:41:47 +0000 (11:41 +0200)
committerDaniel Calviño Sánchez <danxuliu@gmail.com>
Tue, 29 Oct 2019 12:20:08 +0000 (13:20 +0100)
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
apps/files/src/views/Sidebar.vue

index e99389de75f28c91f6429fb55483b5d72a8c41e2..879f71d8a12920c443abd1b145769b43531da5f7 100644 (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)