From 2fa135294efe88745e9b1a274ee9c6629bd2eeb5 Mon Sep 17 00:00:00 2001 From: "Brett M. Morris" Date: Tue, 23 Jul 2024 10:12:16 -0400 Subject: [PATCH] only allow new components for ephemeris queries --- lcviz/plugins/ephemeris/ephemeris.py | 4 ++-- lcviz/plugins/ephemeris/ephemeris.vue | 8 +------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/lcviz/plugins/ephemeris/ephemeris.py b/lcviz/plugins/ephemeris/ephemeris.py index b51f618..f9a2a03 100644 --- a/lcviz/plugins/ephemeris/ephemeris.py +++ b/lcviz/plugins/ephemeris/ephemeris.py @@ -700,12 +700,12 @@ def vue_adopt_from_catalog(self, *args): def adopt_from_catalog_in_new_viewer(self, *args): new_component_label = self.query_result_selected.replace(' ', '') - if len(self._get_phase_viewers(new_component_label)): + if new_component_label in self.component.choices: # warn the user that an ephemeris component already exists with this label, # a second won't be added: self.hub.broadcast( SnackbarMessage( - f"Ephemeris component {new_component_label} already exists, skipping", + f"Ephemeris component {new_component_label} already exists, skipping.", sender=self, color="warning" ) ) diff --git a/lcviz/plugins/ephemeris/ephemeris.vue b/lcviz/plugins/ephemeris/ephemeris.vue index ca405e8..f7c207b 100644 --- a/lcviz/plugins/ephemeris/ephemeris.vue +++ b/lcviz/plugins/ephemeris/ephemeris.vue @@ -244,15 +244,9 @@ -
- - Adopt in this viewer - -
- Adopt in a new viewer + Create new component