Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions frontend/viewer/src/home/HomeView.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
onclick={() => refreshProjects()}/>
</div>
<div>
{#each projects.filter((p) => p.crdt) as project (project.id ?? project)}
{#each projects.filter((p) => p.crdt) as project (project)}
{@const server = project.server}
{@const loading = deletingProject === project.id}
<div out:send={{key: 'project-' + project.code}} in:receive={{key: 'project-' + project.code}}>
Expand Down Expand Up @@ -249,7 +249,9 @@
<div>
<p class="sub-title">{$t`Classic FieldWorks Projects`}</p>
<div>
{#each projects.filter((p) => p.fwdata) as project (project.name)}
<!-- project.name (and maybe code as well) can have duplicates
if there are 2 fwdata projects whose names are the name and code of a crdt project -->
{#each projects.filter((p) => p.fwdata) as project (project)}
<Anchor href={`/fwdata/${project.code}`}>
<ProjectListItem {project}>
{#snippet icon()}
Expand Down
6 changes: 4 additions & 2 deletions frontend/viewer/src/project/ProjectDropdown.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,12 @@
{:else}
<Command.Empty>{$t`No Dictionaries found`}</Command.Empty>
{#each projectsResource.current ?? [] as project (project)}
{@const isCurrentProject = project.crdt === isCrdt &&
(isCrdt ? project.name === projectName : project.code === projectName)}
<Command.Item
value={project.name + project.crdt}
value={`${project.name}-${project.code}-${project.crdt}`}
onSelect={() => handleSelect(project)}
class={cn('cursor-pointer', (project.name === projectName || project.code === projectName) && project.crdt === isCrdt && 'bg-secondary')}
class={cn('cursor-pointer', isCurrentProject && 'bg-secondary')}
>
{@render projectIcon(project.crdt)}
<ProjectTitle {project} />
Expand Down
2 changes: 2 additions & 0 deletions frontend/viewer/src/url-tracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export function trackUrl(appStorage: AppStorage) {
const currentUrl = pathname + search + hash;

if (currentUrl === lastSavedUrl) return;
if (pathname.startsWith('/api/')) return;

await appStorage.lastUrl.set(pathname + search + hash);
lastSavedUrl = currentUrl;
}) as () => void;
Expand Down
Loading