From 969cdb5182d527deb0188823405a8aa46a6ab3e6 Mon Sep 17 00:00:00 2001 From: Simone Gotti Date: Thu, 16 May 2019 00:35:11 +0200 Subject: [PATCH] createproject: keep only remote source with related linked account --- src/components/createproject.vue | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/components/createproject.vue b/src/components/createproject.vue index 7193515..1aff78a 100644 --- a/src/components/createproject.vue +++ b/src/components/createproject.vue @@ -146,7 +146,19 @@ export default { this.$store.dispatch("setError", error); return; } - this.remoteSources = data; + + let allRemoteSources = data; + let remoteSources = []; + for (var i = 0; i < allRemoteSources.length; i++) { + for (var j = 0; j < this.user.linked_accounts.length; j++) { + let remotesource = allRemoteSources[i]; + let la = this.user.linked_accounts[j]; + if (la.remote_source_id == remotesource.id) { + remoteSources.push(remotesource); + } + } + this.remoteSources = remoteSources; + } } };