summaryrefslogtreecommitdiffstats
path: root/apps/files/js
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2023-04-27 10:40:19 +0200
committerJohn Molakvoæ <skjnldsv@protonmail.com>2023-07-05 16:20:33 +0200
commitf029c8bd82e94479fef047f1147d025a523bcba7 (patch)
tree0e2f9b537fd1a7adacd345a21f1b7ddb705ac6d2 /apps/files/js
parent0984970cd8759ae2dcd7dfdfe41d5816bf3c2948 (diff)
downloadnextcloud-server-f029c8bd82e94479fef047f1147d025a523bcba7.tar.gz
nextcloud-server-f029c8bd82e94479fef047f1147d025a523bcba7.zip
fix(files): fix favorites legacy to vue handling and sorting
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files/js')
-rw-r--r--apps/files/js/tagsplugin.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/files/js/tagsplugin.js b/apps/files/js/tagsplugin.js
index 6759aa7002b..cda188803db 100644
--- a/apps/files/js/tagsplugin.js
+++ b/apps/files/js/tagsplugin.js
@@ -194,13 +194,25 @@
tags = tags.split('|');
tags = _.without(tags, '');
var isFavorite = tags.indexOf(OC.TAG_FAVORITE) >= 0;
+
+ // Fake Node object for vue compatibility
+ const node = {
+ type: 'folder',
+ path: (dir + '/' + fileName).replace(/\/\/+/g, '/'),
+ root: '/files/' + OC.getCurrentUser().uid
+ }
+
if (isFavorite) {
// remove tag from list
tags = _.without(tags, OC.TAG_FAVORITE);
removeFavoriteFromList(dir + '/' + fileName);
+ // vue compatibility
+ window._nc_event_bus.emit('files:favorites:removed', node)
} else {
tags.push(OC.TAG_FAVORITE);
addFavoriteToList(dir + '/' + fileName);
+ // vue compatibility
+ window._nc_event_bus.emit('files:favorites:added', node)
}
// pre-toggle the star