Skip to content

Commit

Permalink
BaseBranch: Display the integrate upstream modal
Browse files Browse the repository at this point in the history
  • Loading branch information
estib-vega committed Sep 23, 2024
1 parent 6ec40a3 commit 7de64e7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions apps/desktop/src/lib/components/BaseBranch.svelte
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script lang="ts">
import IntegrateUpstreamModal from './IntegrateUpstreamModal.svelte';
import { Project } from '$lib/backend/projects';
import { BaseBranchService } from '$lib/baseBranch/baseBranchService';
import CommitAction from '$lib/commit/CommitAction.svelte';
import CommitCard from '$lib/commit/CommitCard.svelte';
import { transformAnyCommit } from '$lib/commitLines/transformers';
import UpdateBaseButton from '$lib/components/UpdateBaseButton.svelte';
import { projectMergeUpstreamWarningDismissed } from '$lib/config/config';
import { getGitHost } from '$lib/gitHost/interface/gitHost';
import { ModeService } from '$lib/modes/service';
Expand Down Expand Up @@ -67,9 +67,9 @@
let baseBranchIsUpdating = $state<boolean>(false);
let updateTargetModal = $state<Modal>();
let confirmResetModal = $state<Modal>();
let integrateUpstreamModal = $state<IntegrateUpstreamModal | undefined>();
let resetActionType = $state<ResetActionType | undefined>(undefined);
let mergeUpstreamWarningDismissedCheckbox = $state<boolean>(false);
let updateBaseButton = $state<UpdateBaseButton | undefined>();
const multiple = $derived(
base ? base.upstreamCommits.length > 1 || base.upstreamCommits.length === 0 : false
Expand Down Expand Up @@ -196,14 +196,16 @@
{multiple ? 'commits' : 'commit'}
</div>

<IntegrateUpstreamModal bind:this={integrateUpstreamModal} />

<Button
style="pop"
kind="solid"
tooltip={`Merges the commits from ${base.branchName} into the base of all applied virtual branches`}
disabled={$mode?.type !== 'OpenWorkspace'}
onclick={() => {
if (project.succeedingRebases) {
updateBaseButton?.openModal();
integrateUpstreamModal?.show();
} else {
if ($mergeUpstreamWarningDismissed) {
updateBaseBranch();
Expand Down

0 comments on commit 7de64e7

Please # to comment.