Skip to content

Commit

Permalink
Don't show bookmark icon for configured seeds
Browse files Browse the repository at this point in the history
  • Loading branch information
rudolfs committed Aug 5, 2024
1 parent 6f3164a commit a5b2aac
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions src/views/nodes/SeedSelector.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -151,30 +151,30 @@
</svelte:fragment>
</Popover>

<IconButton
on:click={() => {
if (some($bookmarkedSeeds, baseUrl)) {
bookmarkedSeeds.update(previous => previous.filter(x => x !== baseUrl));
} else {
bookmarkedSeeds.update(previous => [...previous, baseUrl]);
}

closeFocused();
void push({
resource: "nodes",
params: { baseUrl: determineSeed(), projectPageIndex: 0 },
});
}}
disabled={some(config.preferredSeeds, baseUrl)}
title={some(config.preferredSeeds, baseUrl)
? "Default seeds can not be removed"
: undefined}>
{#if some(config.preferredSeeds, baseUrl)}
<Icon name="bookmark-off" />
{:else if some($bookmarkedSeeds, baseUrl)}
<Icon name="bookmark-on" />
{:else}
<Icon name="bookmark-off" />
{/if}
</IconButton>
{#if !some(config.preferredSeeds, baseUrl)}
<IconButton
on:click={() => {
if (some($bookmarkedSeeds, baseUrl)) {
bookmarkedSeeds.update(previous =>
previous.filter(x => x !== baseUrl),
);
void push({
resource: "nodes",
params: { baseUrl: determineSeed(), projectPageIndex: 0 },
});
} else {
bookmarkedSeeds.update(previous => [...previous, baseUrl]);
}
}}
disabled={some(config.preferredSeeds, baseUrl)}
title={some(config.preferredSeeds, baseUrl)
? "Default seeds can not be removed"
: undefined}>
{#if some($bookmarkedSeeds, baseUrl)}
<Icon name="bookmark-on" />
{:else}
<Icon name="bookmark-off" />
{/if}
</IconButton>
{/if}
</div>

0 comments on commit a5b2aac

Please sign in to comment.