From fef53c117614e86f75bceeb2d789ea6b435c678e Mon Sep 17 00:00:00 2001 From: Richard Bowman Date: Thu, 29 Feb 2024 22:40:41 +0000 Subject: [PATCH] Start modals on mount, not create The calibration modal was not starting properly, because the component was not mounted when its show method was called. Calling it from the `mounted` method solves the problem and we don't get the error. I'm not 100% sure this was introduced by refactoring the taskSubmitter, though it's possible. However, I think the fix is uncontroversial and it should probably have been there all along. --- webapp/src/components/appContent.vue | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/webapp/src/components/appContent.vue b/webapp/src/components/appContent.vue index 4a9dd021..05d673b9 100644 --- a/webapp/src/components/appContent.vue +++ b/webapp/src/components/appContent.vue @@ -253,12 +253,6 @@ export default { ...mapState({ imjoyEnabled: "imjoyEnabled" }) }, - created: function() { - if (this.$store.getters.ready) { - this.startModals(); - } - }, - mounted() { // A global signal listener to switch tab this.$root.$on("globalSwitchTab", tabID => { @@ -272,6 +266,9 @@ export default { this.$root.$on("globalDecrementTab", () => { this.incrementTabBy(-1); }); + if (this.$store.getters.ready) { + this.startModals(); + } }, methods: { @@ -289,7 +286,10 @@ export default { this.currentTab = newId; }, startModals: function() { - this.$refs["calibrationModal"].show(); + console.log(this.$refs); + let modal = this.$refs.calibrationModal; + console.log("modal", modal); + modal.show(); }, enterApp: function() { // Stuff to do once connected and all init modals are finished