From 54efebf12ee3d2dd7e7eb138f53f790e7352aaf4 Mon Sep 17 00:00:00 2001 From: philipp lang Date: Tue, 30 Jul 2024 23:22:46 +0200 Subject: [PATCH] Add loginState to skip nami login --- src/components/fields/Nami.vue | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/src/components/fields/Nami.vue b/src/components/fields/Nami.vue index 4d999fb..8953c10 100644 --- a/src/components/fields/Nami.vue +++ b/src/components/fields/Nami.vue @@ -13,16 +13,27 @@ Bitte achte außerdem darauf, dass du mindestens Leserechte auf deine Gruppierung hast. Diese kann dir i.d.R. dein StaVo erteilen.

+
- Anmelden + + +
@@ -225,7 +236,7 @@ if (user.value !== null) { const {resolveComponentName} = useFields(); const step = computed(() => { - if (user.value === null) { + if (user.value === null && loginState.value !== 'skipped') { return 1; } @@ -247,6 +258,7 @@ function deleteMember(index) { } const membersAccepted = ref(false); +const loginState = ref('nami'); const membersCompleted = ref(false); const emit = defineEmits(['update:modelValue']); const props = defineProps({ @@ -288,6 +300,13 @@ const inner = computed( {deep: true}, ); async function innerLogin() { + if (loginState.value === 'skipping') { + loginState.value = 'skipped'; + membersAccepted.value = true; + membersCompleted.value = false; + return; + } + await login(); membersAccepted.value = false; membersCompleted.value = false; @@ -312,8 +331,11 @@ function toggleMember(member) { } async function innerLogout() { - logout(); - resetSearchData(); + if (loginState.value !== 'skipped') { + logout(); + resetSearchData(); + } + loginState.value = 'nami'; membersAccepted.value = false; membersCompleted.value = false; inner.value = [];