fix: rm unnecessary svelte-french-toast imports

This commit is contained in:
ndom91 2024-06-04 10:49:44 +02:00
parent bd77da52a9
commit 71463b91c8
No known key found for this signature in database
2 changed files with 9 additions and 9 deletions

View File

@ -14,7 +14,6 @@
import { getContext, getContextStore } from '$lib/utils/context'; import { getContext, getContextStore } from '$lib/utils/context';
import { BranchController } from '$lib/vbranches/branchController'; import { BranchController } from '$lib/vbranches/branchController';
import { BaseBranch, Branch } from '$lib/vbranches/types'; import { BaseBranch, Branch } from '$lib/vbranches/types';
import toast from 'svelte-french-toast';
import type { PullRequest } from '$lib/github/types'; import type { PullRequest } from '$lib/github/types';
import type { Persisted } from '$lib/persisted/persisted'; import type { Persisted } from '$lib/persisted/persisted';
import { goto } from '$app/navigation'; import { goto } from '$app/navigation';
@ -66,12 +65,12 @@
async function createPr(createPrOpts: CreatePrOpts): Promise<PullRequest | undefined> { async function createPr(createPrOpts: CreatePrOpts): Promise<PullRequest | undefined> {
const opts = { ...defaultPrOpts, ...createPrOpts }; const opts = { ...defaultPrOpts, ...createPrOpts };
if (!githubService.isEnabled) { if (!githubService.isEnabled) {
toast.error('Cannot create PR without GitHub credentials'); showError('Cannot create PR without GitHub credentials');
return; return;
} }
if (!$baseBranch?.shortName) { if (!$baseBranch?.shortName) {
toast.error('Cannot create PR without base branch'); showError('Cannot create PR without base branch');
return; return;
} }
@ -139,7 +138,8 @@
<div <div
class="header card" class="header card"
class:header_target-branch={branch.selectedForChanges} class:header_target-branch={branch.selectedForChanges}
class:header_target-branch-animation={isTargetBranchAnimated && branch.selectedForChanges} class:header_target-branch-animation={isTargetBranchAnimated &&
branch.selectedForChanges}
> >
<div class="header__info-wrapper"> <div class="header__info-wrapper">
{#if !isUnapplied} {#if !isUnapplied}
@ -255,7 +255,8 @@
<div class="header__buttons"> <div class="header__buttons">
{#if !hasPullRequest} {#if !hasPullRequest}
<PullRequestButton <PullRequestButton
on:click={async (e) => await createPr({ draft: e.detail.action == 'draft' })} on:click={async (e) =>
await createPr({ draft: e.detail.action == 'draft' })}
loading={isLoading} loading={isLoading}
/> />
{/if} {/if}

View File

@ -5,12 +5,12 @@
import Button from '$lib/components/Button.svelte'; import Button from '$lib/components/Button.svelte';
import Icon from '$lib/components/Icon.svelte'; import Icon from '$lib/components/Icon.svelte';
import ViewPrContextMenu from '$lib/components/ViewPrContextMenu.svelte'; import ViewPrContextMenu from '$lib/components/ViewPrContextMenu.svelte';
import { showError } from '$lib/notifications/toasts';
import { getContext } from '$lib/utils/context'; import { getContext } from '$lib/utils/context';
import { tooltip } from '$lib/utils/tooltip'; import { tooltip } from '$lib/utils/tooltip';
import { openExternalUrl } from '$lib/utils/url'; import { openExternalUrl } from '$lib/utils/url';
import { BranchController } from '$lib/vbranches/branchController'; import { BranchController } from '$lib/vbranches/branchController';
import { onDestroy } from 'svelte'; import { onDestroy } from 'svelte';
import toast from 'svelte-french-toast';
import type { PullRequest } from '$lib/github/types'; import type { PullRequest } from '$lib/github/types';
import type { BaseBranch, RemoteBranch } from '$lib/vbranches/types'; import type { BaseBranch, RemoteBranch } from '$lib/vbranches/types';
import { goto } from '$app/navigation'; import { goto } from '$app/navigation';
@ -99,9 +99,8 @@
await branchController.createvBranchFromBranch(branch.name); await branchController.createvBranchFromBranch(branch.name);
goto(`/${project.id}/board`); goto(`/${project.id}/board`);
} catch (e) { } catch (e) {
const err = 'Failed to apply branch'; showError('Failed to apply branch', e);
toast.error(err); console.error(e);
console.error(err, e);
} finally { } finally {
isApplying = false; isApplying = false;
} }