From 75d552b29e572e1179a7f5767bd7dd7f7614de61 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 9 Feb 2016 17:18:07 +0100 Subject: Listen to the notification event to reload the file list --- apps/files_sharing/js/external.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'apps') diff --git a/apps/files_sharing/js/external.js b/apps/files_sharing/js/external.js index 45a6ef02758..0ca8213168e 100644 --- a/apps/files_sharing/js/external.js +++ b/apps/files_sharing/js/external.js @@ -69,9 +69,21 @@ filesApp: null, attach: function(filesApp) { + var self = this; this.filesApp = filesApp; this.processIncomingShareFromUrl(); - this.processSharesToConfirm(); + + if (!$('#header').find('div.notifications').length) { + // No notification app, display the modal + this.processSharesToConfirm(); + } + + $('body').on('OCA.Notification.Action', function(e) { + if (e.notification.app === 'files_sharing' && e.notification.object_type === 'remote_share' && e.action.type === 'POST') { + // User accepted a remote share reload + self.filesApp.fileList.reload(); + } + }); }, /** -- cgit v1.2.3