From d3aac0912570571cfa7f121ba318a0b29d2519c0 Mon Sep 17 00:00:00 2001 From: NicolasRichel Date: Fri, 3 Nov 2023 09:39:39 +0100 Subject: [PATCH] PATCH: fix: avoid taking snapshot for empty viewers --- src/components/bcf-topic-form/BcfTopicForm.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/bcf-topic-form/BcfTopicForm.vue b/src/components/bcf-topic-form/BcfTopicForm.vue index 46c1683..d134339 100644 --- a/src/components/bcf-topic-form/BcfTopicForm.vue +++ b/src/components/bcf-topic-form/BcfTopicForm.vue @@ -346,9 +346,11 @@ export default { const createViewpoints = () => { Promise.all( - ($viewer?.globalContext.getViewers() ?? []).map(viewer => - viewer.getViewpoint().then(viewpoint => viewpointsToCreate.value.push(viewpoint)) - ) + ($viewer?.globalContext.getViewers() ?? []) + .filter(viewer => viewer.getLoadedModels().length > 0) + .map(viewer => + viewer.getViewpoint().then(viewpoint => viewpointsToCreate.value.push(viewpoint)) + ) ); };