From 84f8048e0af0f55bb28d3c5798d8402ec21900b6 Mon Sep 17 00:00:00 2001 From: Andrew Bastin Date: Thu, 6 May 2021 12:06:19 -0400 Subject: [PATCH] Initial introduction of TeamCollectionAdapter based collection render --- components/collections/index.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/components/collections/index.vue b/components/collections/index.vue index ec3e62a2f..579130651 100644 --- a/components/collections/index.vue +++ b/components/collections/index.vue @@ -147,7 +147,8 @@ import { fb } from "~/helpers/fb" import { getSettingSubject } from "~/newstore/settings" import gql from "graphql-tag" -import team_utils from "~/helpers/teams/utils" +import * as team_utils from "~/helpers/teams/utils" +import TeamCollectionAdapter from "~/helpers/teams/TeamCollectionAdapter" export default { props: { @@ -177,11 +178,13 @@ export default { selectedTeam: undefined, }, teamCollections: {}, + teamCollectionAdapter: new TeamCollectionAdapter(null), } }, subscriptions() { return { SYNC_COLLECTIONS: getSettingSubject("syncCollections"), + teamCollectionsNew: this.teamCollectionAdapter.collections$, } }, apollo: { @@ -290,6 +293,9 @@ export default { "collectionsType.type": function emitstuff() { this.$emit("update-collection", this.$data.collectionsType.type) }, + "collectionsType.selectedTeam": function (value) { + if (value?.id) this.teamCollectionAdapter.changeTeamID(value.id) + }, }, computed: { showTeamCollections() { @@ -313,7 +319,7 @@ export default { this.collectionsType.selectedTeam && this.collectionsType.selectedTeam.id in this.teamCollections ) { - collections = this.teamCollections[this.collectionsType.selectedTeam.id] + collections = this.teamCollectionsNew } else { collections = [] }