Skip to content

Commit

Permalink
fix: web / desktop redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmdasifraza committed Oct 3, 2024
1 parent dac7049 commit 039bbed
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
14 changes: 0 additions & 14 deletions src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,6 @@
export let url = '/';
onMount(() => {
// Check the query parameters in the URL
const urlParams = new URLSearchParams(window.location.search);
const source = urlParams.get('source'); // Get 'source' from query param
if(!source) return;
if (source === 'web') {
localStorage.setItem('isUserFromDesktop', 'false');
} else {
localStorage.setItem('isUserFromDesktop', 'true');
}
});
</script>

<Router {url}>
Expand Down
13 changes: 13 additions & 0 deletions src/pages/Auth/entry-point/EntryPoint.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import starIcon from '$lib/assets/starIcon.svg';
import Button from '$lib/components/button/Button.svelte';
import BgContainer from '$lib/components/bgContainer/BgContainer.svelte';
import { onMount } from 'svelte';
let isEmailTouched = false;
//---------------- Login Validation --------------------//
Expand All @@ -32,6 +33,18 @@
loadingMessage: 'Please wait while we are redirecting you to your email account....'
};
let entryLoader = false;
onMount(() => {
// Check the query parameters in the URL
const urlParams = new URLSearchParams(window.location.search);
const source = urlParams.get('source'); // Get 'source' from query param
if (source === 'web') {
localStorage.setItem('isUserFromDesktop', 'false');
} else {
localStorage.setItem('isUserFromDesktop', 'true');
}
});
</script>

{#if isEntry}
Expand Down

0 comments on commit 039bbed

Please sign in to comment.