From 9f5ada5d458429f18d891bfd1e4621330163de65 Mon Sep 17 00:00:00 2001
From: Julius Härtl <jus@bitgrid.net>
Date: Mon, 28 Dec 2020 17:15:15 +0100
Subject: Also include external share results in recommendations
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Julius Härtl <jus@bitgrid.net>
---
 apps/files_sharing/src/components/SharingInput.vue | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'apps/files_sharing/src/components/SharingInput.vue')

diff --git a/apps/files_sharing/src/components/SharingInput.vue b/apps/files_sharing/src/components/SharingInput.vue
index 4222a5589e6..9fa9e47e287 100644
--- a/apps/files_sharing/src/components/SharingInput.vue
+++ b/apps/files_sharing/src/components/SharingInput.vue
@@ -294,6 +294,8 @@ export default {
 				return
 			}
 
+			const externalResults = this.externalResults.filter(result => !result.condition || result.condition(this))
+
 			const exact = request.data.ocs.data.exact
 
 			// flatten array of arrays
@@ -302,6 +304,7 @@ export default {
 			// remove invalid data and format to user-select layout
 			this.recommendations = this.filterOutExistingShares(rawRecommendations)
 				.map(share => this.formatForMultiselect(share))
+				.concat(externalResults)
 
 			this.loading = false
 			console.info('recommendations', this.recommendations)
-- 
cgit v1.2.3

