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 { BranchController } from '$lib/vbranches/branchController';
import { BaseBranch, Branch } from '$lib/vbranches/types';
import toast from 'svelte-french-toast';
import type { PullRequest } from '$lib/github/types';
import type { Persisted } from '$lib/persisted/persisted';
import { goto } from '$app/navigation';
@ -66,12 +65,12 @@
async function createPr(createPrOpts: CreatePrOpts): Promise<PullRequest | undefined> {
const opts = { ...defaultPrOpts, ...createPrOpts };
if (!githubService.isEnabled) {
toast.error('Cannot create PR without GitHub credentials');
showError('Cannot create PR without GitHub credentials');
return;
}
if (!$baseBranch?.shortName) {
toast.error('Cannot create PR without base branch');
showError('Cannot create PR without base branch');
return;
}
@ -139,7 +138,8 @@
<div
class="header card"
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">
{#if !isUnapplied}
@ -255,7 +255,8 @@
<div class="header__buttons">
{#if !hasPullRequest}
<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}
/>
{/if}

View File

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