From faf18b5f02b2f560566965030d6ca97407d3445e Mon Sep 17 00:00:00 2001
From: Arthur Schiwon <blizzz@arthur-schiwon.de>
Date: Fri, 24 Jan 2020 12:50:06 +0100
Subject: [PATCH] apps can have polyamorous relationships with bundles

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
---
 apps/settings/lib/Controller/AppSettingsController.php | 2 +-
 apps/settings/src/components/AppList.vue               | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/apps/settings/lib/Controller/AppSettingsController.php b/apps/settings/lib/Controller/AppSettingsController.php
index 80ba23594a3..a49b57185c3 100644
--- a/apps/settings/lib/Controller/AppSettingsController.php
+++ b/apps/settings/lib/Controller/AppSettingsController.php
@@ -219,7 +219,7 @@ class AppSettingsController extends Controller {
 			foreach($bundle->getAppIdentifiers() as $identifier) {
 				foreach($this->allApps as &$app) {
 					if($app['id'] === $identifier) {
-						$app['bundleId'] = $bundle->getIdentifier();
+						$app['bundleIds'][] = $bundle->getIdentifier();
 						continue;
 					}
 				}
diff --git a/apps/settings/src/components/AppList.vue b/apps/settings/src/components/AppList.vue
index 2fecf137dd8..5a0e570742f 100644
--- a/apps/settings/src/components/AppList.vue
+++ b/apps/settings/src/components/AppList.vue
@@ -158,7 +158,9 @@ export default {
 		bundleApps() {
 			return function(bundle) {
 				return this.$store.getters.getAllApps
-					.filter(app => app.bundleId === bundle)
+					.filter(app => {
+						return app.bundleIds !== undefined && app.bundleIds.includes(bundle)
+					})
 			}
 		},
 		searchApps() {
-- 
GitLab