From 8bbf4016dab7ee328ee3b98b6b99c9c3a3703106 Mon Sep 17 00:00:00 2001 From: xeovalyte Date: Sat, 7 Jan 2023 20:09:18 +0100 Subject: [PATCH] fixed some small issues --- frontend/app.vue | 2 ++ frontend/pages/settings/admin/ledenlijst.vue | 20 ++++++++------------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/frontend/app.vue b/frontend/app.vue index de47dc5..8b631cf 100644 --- a/frontend/app.vue +++ b/frontend/app.vue @@ -70,6 +70,8 @@ onMounted(() => { const data = docSnap.data() userData.value = data getPersons(userData.value.relatiecodes) + } else { + setTimeout(() => window.location.reload(true), 1000) } if (!userData.value.sendNews && route.path === '/news/newmessage') navigateTo('/') diff --git a/frontend/pages/settings/admin/ledenlijst.vue b/frontend/pages/settings/admin/ledenlijst.vue index ad80ebd..81403c7 100644 --- a/frontend/pages/settings/admin/ledenlijst.vue +++ b/frontend/pages/settings/admin/ledenlijst.vue @@ -132,18 +132,14 @@ const csvToJson = (csv) => { for (let i in result) { let groups = [] - if (Array.isArray(result[i].Verenigingssporten)) { - for (let j = 0; j < result[i].Verenigingssporten.length; j++ ) { - let tmp = result[i].Verenigingssporten[j].split(' - ') - tmp.shift() - if (tmp[1] === 'Week') tmp[1] = 'Vrijdag' - groups.push(...tmp) - } - } else { - groups = result[i].Verenigingssporten.split(' - ') - groups.shift() - if (groups[1] === 'Week') groups[1] = 'Vrijdag' - } + const correctGroups = result[i].Verenigingssporten.replace(/,/g, " -") + + console.log(correctGroups) + groups = correctGroups.split(' - ') + if (groups[2] === 'Week') groups[2] = 'Vrijdag' + + groups = groups.filter((item) => item !== "Groep") + ledenlijst.value.push({ relatiecode: result[i].Relatiecode, fullName: result[i]['Volledige naam (1)'], email: [result[i]['E-mail'], result[i]['2e E-mail']], groups: [...new Set(groups)], diploma: result[i]['Diploma dropdown 1'] }) }