From bb0c93dc2fe57b42c6d50564145ad7dcd602254b Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Sun, 10 Apr 2022 00:31:10 +0200 Subject: [PATCH] fix: Return own and other sources better --- src/routes/applications/[id]/configuration/source.svelte | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/routes/applications/[id]/configuration/source.svelte b/src/routes/applications/[id]/configuration/source.svelte index e5c05ebdd..2f23de4d8 100644 --- a/src/routes/applications/[id]/configuration/source.svelte +++ b/src/routes/applications/[id]/configuration/source.svelte @@ -46,15 +46,12 @@ (source.type === 'github' && source.githubAppId && source.githubApp.installationId) || (source.type === 'gitlab' && source.gitlabAppId) ); + console.log(filteredSources); const ownSources = filteredSources.filter((source) => { - if (source.teams[0].id === $session.teamId) { - return source; - } + return source.teams.filter((team) => team.id === $session.teamId); }); const otherSources = filteredSources.filter((source) => { - if (source.teams[0].id !== $session.teamId) { - return source; - } + return source.teams.filter((team) => team.id !== $session.teamId); }); async function handleSubmit(gitSourceId) {