From 41768aec9aebb9259daf5142c0527fd6f704f8c8 Mon Sep 17 00:00:00 2001 From: Luc Claustres Date: Thu, 13 Jun 2024 12:31:14 +0200 Subject: [PATCH] fix: Saving a layer update the project even if from another planet (closes #879) --- map/client/components/catalog/KCreateView.vue | 4 ++-- map/client/mixins/mixin.activity.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/map/client/components/catalog/KCreateView.vue b/map/client/components/catalog/KCreateView.vue index f0d676cda..86d328ac9 100644 --- a/map/client/components/catalog/KCreateView.vue +++ b/map/client/components/catalog/KCreateView.vue @@ -102,8 +102,8 @@ export default { try { this.creating = true const createdView = await this.kActivity.saveContext(view) - // Add view to current project ? - if (this.project) { + // Add view to current project ? Check if not coming from another planet first + if (this.project && (project.getPlanetApi() === this.$api)) { this.project.views.push({ _id: createdView._id }) await this.$api.getService('projects').patch(this.project._id, { views: this.project.views diff --git a/map/client/mixins/mixin.activity.js b/map/client/mixins/mixin.activity.js index 174d38a78..0c811ca5b 100644 --- a/map/client/mixins/mixin.activity.js +++ b/map/client/mixins/mixin.activity.js @@ -184,8 +184,8 @@ export const activity = { // Otherwise simply save in catalog createdLayer = await layers.saveLayer(layer) } - // Add layer to current project ? - if (this.project) { + // Add layer to current project ? Check if not coming from another planet first + if (this.project && (project.getPlanetApi() === this.$api)) { this.project.layers.push({ _id: createdLayer._id }) await this.$api.getService('projects').patch(this.project._id, { layers: this.project.layers