Skip to content

Reo #1779

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Reo #1779

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { browser } from '$app/environment';
import { browser, dev } from '$app/environment';
import { afterNavigate, goto } from '$app/navigation';
import { base } from '$app/paths';
import { page } from '$app/stores';
Expand Down Expand Up @@ -106,8 +106,42 @@
}
}
}

onMount(() => {
const reoIdentity = {
username: $user.email,
type: $user.password ? 'email' : 'github',
firstname: $user.name.split(' ')[0],
lastname: $user.name.split(' ')[1]
Comment on lines +114 to +115
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if name is null? What if they only have a 1 word name?

What happens if the user isn't logged in already?

};

if (dev || !Object.keys($user).length) return;
// @ts-expect-error

Check failure on line 119 in src/routes/+layout.svelte

View workflow job for this annotation

GitHub Actions / build

Include a description after the "@ts-expect-error" directive to explain why the @ts-expect-error is necessary. The description must be 3 characters or longer
Reo.identify(reoIdentity);

Check failure on line 120 in src/routes/+layout.svelte

View workflow job for this annotation

GitHub Actions / build

'Reo' is not defined
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typically, you would identify a user right after they successfully log in and/or you get the user.

});
</script>

<svelte:head>
{#if !dev && browser}
<!-- Start of Reo Javascript -->
<script type="text/javascript">
!(function () {
var e, t, n;
(e = '144fa7eaa4904e8'),
(t = function () {
Reo.init({ clientID: '144fa7eaa4904e8' });
}),
((n = document.createElement('script')).src =
'https://static.reo.dev/' + e + '/reo.js'),
(n.defer = !0),
(n.onload = t),
document.head.appendChild(n);
})();
</script>
<!-- End of Reo Javascript -->
{/if}
</svelte:head>

<Notifications />
<!-- {#if isCloud}
<Consent />
Expand Down
Loading