Browse Source

fix branch display

main
Silberengel 4 weeks ago
parent
commit
a7d3e897cc
  1. 8
      src/routes/repos/[npub]/[repo]/+page.svelte

8
src/routes/repos/[npub]/[repo]/+page.svelte

@ -51,7 +51,7 @@
let editedContent = $state(''); let editedContent = $state('');
let hasChanges = $state(false); let hasChanges = $state(false);
let saving = $state(false); let saving = $state(false);
let branches = $state<string[]>([]); let branches = $state<Array<string | { name: string; commit?: any }>>([]);
let currentBranch = $state('main'); let currentBranch = $state('main');
let commitMessage = $state(''); let commitMessage = $state('');
let userPubkey = $state<string | null>(null); let userPubkey = $state<string | null>(null);
@ -2353,7 +2353,8 @@
{#if branches.length > 0} {#if branches.length > 0}
<select bind:value={currentBranch} onchange={handleBranchChange} class="branch-select"> <select bind:value={currentBranch} onchange={handleBranchChange} class="branch-select">
{#each branches as branch} {#each branches as branch}
<option value={branch}>{branch}</option> {@const branchName = typeof branch === 'string' ? branch : (branch as { name: string }).name}
<option value={branchName}>{branchName}</option>
{/each} {/each}
</select> </select>
{/if} {/if}
@ -3176,7 +3177,8 @@
From Branch: From Branch:
<select bind:value={newBranchFrom}> <select bind:value={newBranchFrom}>
{#each branches as branch} {#each branches as branch}
<option value={branch}>{branch}</option> {@const branchName = typeof branch === 'string' ? branch : (branch as { name: string }).name}
<option value={branchName}>{branchName}</option>
{/each} {/each}
</select> </select>
</label> </label>

Loading…
Cancel
Save