Skip to content
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

Use external url opener on login page #2989

Merged
merged 1 commit into from
Mar 2, 2024
Merged
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
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
Loading