Skip to content

Commit

Permalink
Use external url opener on login page
Browse files Browse the repository at this point in the history
- provides a toast with feedback on error
  • Loading branch information
mtsgrd committed Mar 2, 2024
1 parent 24bf86a commit e5cdd0f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gitbutler-ui/src/lib/components/Login.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import Button from './Button.svelte';
import { getCloudApiClient, type LoginToken } from '$lib/backend/cloud';
import * as toasts from '$lib/utils/toasts';
import { open } from '@tauri-apps/api/shell';
import { openExternalUrl } from '$lib/utils/url';
import { createEventDispatcher } from 'svelte';
import { derived, writable } from 'svelte/store';
import type { UserService } from '$lib/stores/user';
Expand Down Expand Up @@ -73,14 +73,14 @@
{#if minimal}
Your browser should have been opened. Please log into your GitButler account there.
{:else}
{#await Promise.all([open($token.url), pollForUser($token.token)])}
{#await Promise.all([openExternalUrl($token.url), pollForUser($token.token)])}
<div class="text-light-700">
Your browser should have been opened. Please log into your GitButler account there.
</div>
{/await}
<p>
If you were not redirected automatically, you can
<button class="underline" on:click={() => open($authUrl)}>click here</button>
<button class="underline" on:click={() => openExternalUrl($authUrl)}>click here</button>
</p>
{/if}
{:else}
Expand Down

0 comments on commit e5cdd0f

Please sign in to comment.