From 863c70222b9252fe8b9754da987411e28b6e3f1b Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Fri, 8 Jul 2022 08:44:01 -0500 Subject: [PATCH] Better handling of provide failing Was having trouble with Vite HMR --- src/components/Node.vue | 6 ++++-- src/features/links/Links.vue | 7 +++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/components/Node.vue b/src/components/Node.vue index c844c26..e1686e3 100644 --- a/src/components/Node.vue +++ b/src/components/Node.vue @@ -9,8 +9,10 @@ import { computed, inject, onUnmounted, ref, toRefs, unref, watch } from "vue"; const _props = defineProps<{ id: string }>(); const props = toRefs(_props); -const register = inject(RegisterNodeInjectionKey); -const unregister = inject(UnregisterNodeInjectionKey); +// eslint-disable-next-line @typescript-eslint/no-empty-function +const register = inject(RegisterNodeInjectionKey, () => {}); +// eslint-disable-next-line @typescript-eslint/no-empty-function +const unregister = inject(UnregisterNodeInjectionKey, () => {}); const node = ref(null); const parentNode = computed(() => node.value && node.value.parentElement); diff --git a/src/features/links/Links.vue b/src/features/links/Links.vue index b9117c3..bbf4740 100644 --- a/src/features/links/Links.vue +++ b/src/features/links/Links.vue @@ -14,6 +14,7 @@