Skip to content

Commit 36483d2

Browse files
committed
fix: unsubscribe groups, check for all street provider names starting with panoramax
1 parent c6d54d7 commit 36483d2

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

src/components/StreetProject.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export default defineComponent({
179179
</project-info>
180180
</project-header>
181181
<street-project-task-panoramax
182-
v-if="project.imageProvider?.name == 'panoramax'"
182+
v-if="project.imageProvider?.name?.startsWith('panoramax')"
183183
:taskId="taskId"
184184
:endpoint="panoramaxEndpoint"
185185
@dataloading="(e) => (isLoading = e)"

src/components/StreetProjectTutorial.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ export default defineComponent({
224224
<v-row justify="center">
225225
<v-col>
226226
<street-project-task-panoramax
227-
v-if="taskId && tutorial && tutorial.imageProvider?.name == 'panoramax'"
227+
v-if="taskId && tutorial && tutorial.imageProvider?.name?.startsWith('panoramax')"
228228
:key="taskId"
229229
:taskId="taskId"
230230
:endpoint="panoramaxEndpoint"

src/views/ProjectView.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export default defineComponent({
5252
tutorial: null,
5353
tutorialTasks: null,
5454
to: null,
55+
unsubscribeGroup: null,
5556
}
5657
},
5758
provide() {
@@ -155,7 +156,7 @@ export default defineComponent({
155156
})
156157
},
157158
bindTaskGroup() {
158-
onValue(getGroupsQuery(this.projectId), (snapshot) => {
159+
this.unsubscribeGroup = onValue(getGroupsQuery(this.projectId), (snapshot) => {
159160
const data = snapshot.val() || {}
160161
const flatGroups = Object.values(data).flat()
161162
const completed = Object.keys(this.projectContributions)
@@ -213,6 +214,11 @@ export default defineComponent({
213214
},
214215
continueMapping() {
215216
this.nextDialog = false
217+
// Disconnect and reconnect to force fresh group data
218+
if (this.unsubscribeGroup) {
219+
this.unsubscribeGroup()
220+
}
221+
this.bindTaskGroup()
216222
this.mode = 'contribute'
217223
},
218224
i18nRoute,

0 commit comments

Comments
 (0)