From 975297722a2929c9eb85a9147f9bb1f71c6529a5 Mon Sep 17 00:00:00 2001 From: Eric van der Vlist Date: Sun, 5 Mar 2023 10:04:18 +0100 Subject: [PATCH] Supporting invitations through geo URLs --- src/components/user/User.tsx | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/components/user/User.tsx b/src/components/user/User.tsx index 102ed67..581c80b 100644 --- a/src/components/user/User.tsx +++ b/src/components/user/User.tsx @@ -50,12 +50,19 @@ const User: Component = (props) => { return { token: uuid(), subscriptions: [], ...values() }; }; - const invitationLink = () => { + const invitationLink = (type = 'https') => { // TODO: make these URLs configurable - const configUrl = `https://admin.dyomedea.app/api/conf/${ - getValues().token - }`; - return `https://web.dyomedea.app#${btoa(configUrl)}`; + if (type === 'https') { + const configUrl = `https://admin.dyomedea.app/api/conf/${ + getValues().token + }`; + return `https://web.dyomedea.app#${btoa(configUrl)}`; + } else { + const configUrl = `https://admin.dyomedea.app/api/conf/${ + getValues().token + }`; + return `geo:?invitation=${btoa(configUrl)}`; + } }; const submitHandler = async (values: any, context: any) => { @@ -329,8 +336,12 @@ const User: Component = (props) => {

{userId(data('username'), data('database'))}

+ Invitations : - Invitation + https + + + geo