Skip to content

Commit

Permalink
Remove duplicate instance of ForgePrMonitor
Browse files Browse the repository at this point in the history
- pr did not refresh after merging
  • Loading branch information
mtsgrd committed Nov 19, 2024
1 parent a215cc3 commit 8dc6316
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
2 changes: 1 addition & 1 deletion apps/desktop/src/lib/branch/SeriesHeader.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -347,12 +347,12 @@
{#if $prService && !hasNoCommits}
{#if $pr}
<PullRequestCard
upstreamName={currentSeries.name}
reloadPR={handleReloadPR}
reopenPr={handleReopenPr}
openPrDetailsModal={handleOpenPR}
pr={$pr}
{checksMonitor}
{prMonitor}
/>
{:else}
<Button
Expand Down
13 changes: 3 additions & 10 deletions apps/desktop/src/lib/pr/PullRequestCard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@
import { getContext, getContextStore } from '@gitbutler/shared/context';
import Button from '@gitbutler/ui/Button.svelte';
import { type ComponentColor } from '@gitbutler/ui/utils/colorTypes';
import type { ForgePrMonitor } from '$lib/forge/interface/forgePrMonitor';
import type { DetailedPullRequest } from '$lib/forge/interface/types';
import type { MessageStyle } from '$lib/shared/InfoMessage.svelte';
import type iconsJson from '@gitbutler/ui/data/icons.json';
interface Props {
upstreamName: string;
pr: DetailedPullRequest;
checksMonitor?: ForgeChecksMonitor;
prMonitor?: ForgePrMonitor;
reloadPR: () => void;
reopenPr: () => Promise<void>;
openPrDetailsModal: () => void;
}
const { upstreamName, pr, checksMonitor, reloadPR, reopenPr, openPrDetailsModal }: Props =
$props();
const { pr, checksMonitor, prMonitor, reloadPR, reopenPr, openPrDetailsModal }: Props = $props();
type StatusInfo = {
text: string;
Expand All @@ -49,14 +49,7 @@
const project = getContext(Project);
const forgeListingService = getForgeListingService();
const prStore = $derived($forgeListingService?.prs);
const prs = $derived(prStore ? $prStore : undefined);
const listedPr = $derived(prs?.find((pr) => pr.sourceBranch === upstreamName));
const prNumber = $derived(listedPr?.number);
const prService = getForgePrService();
const prMonitor = $derived(prNumber ? $prService?.prMonitor(prNumber) : undefined);
const checks = $derived(checksMonitor?.status);
Expand Down

0 comments on commit 8dc6316

Please sign in to comment.