Fix criteria for showing push button

This commit is contained in:
Mattias Granlund 2024-05-24 11:57:59 +01:00
parent 62755f348e
commit 867323cfee
2 changed files with 3 additions and 4 deletions

View File

@ -21,7 +21,7 @@
$: hasUnknownCommits = $unknownCommits.length > 0;
</script>
{#if hasCommits}
{#if hasCommits || hasUnknownCommits}
<div class="commit-list__content">
<div class="title text-base-13 text-semibold"></div>
<div class="commits">

View File

@ -14,7 +14,7 @@
import { persisted, type Persisted } from '$lib/persisted/persisted';
import { getContext } from '$lib/utils/context';
import * as toasts from '$lib/utils/toasts';
import { getLocalCommits, getUnknownCommits, getUpstreamCommits } from '$lib/vbranches/contexts';
import { getLocalCommits, getUnknownCommits } from '$lib/vbranches/contexts';
import { createEventDispatcher } from 'svelte';
import type { Branch } from '$lib/vbranches/types';
@ -24,7 +24,6 @@
const project = getContext(Project);
const localCommits = getLocalCommits();
const upstreamCommits = getUpstreamCommits();
const unknownCommits = getUnknownCommits();
function defaultAction(): Persisted<BranchAction> {
@ -39,7 +38,7 @@
let dropDown: DropDownButton;
let disabled = false;
let isPushed = $localCommits.length == 0 && !branch.requiresForce;
$: canBeRebased = $upstreamCommits.length != $unknownCommits.length;
$: canBeRebased = $unknownCommits.length > 0;
$: selection$ = contextMenu?.selection$;
$: action = selectAction(isPushed, $preferredAction);