- {#if search == ''}
- {#each groups as group}
-
- {group.name}
-
-
- {#each group.actions as action, index}
-
- {/each}
-
+
+
+
+
+ {#each filteredGroups as group, groupIndex}
+
+
{group.name}
+
+ {#each group.actions as action, actionIndex}
+ {@const globalIndex =
+ filteredGroups
+ .slice(0, groupIndex)
+ .reduce((sum, g) => sum + g.actions.length, 0) + actionIndex}
+ -
+
+
+ {/each}
+
+
{/each}
- {:else}
-
- {#each filteredActions as action, index}
-
- {/each}
-
- {/if}
+
+
+ {$t('nav.commands.search', { default: '' })}
+
+
+
diff --git a/src/lib/components/ui/navbar/commands/actions.ts b/src/lib/components/ui/navbar/commands/actions.ts
new file mode 100644
index 00000000..e69de29b
diff --git a/src/lib/i18n/en.json b/src/lib/i18n/en.json
index c2aa36e1..359591ae 100644
--- a/src/lib/i18n/en.json
+++ b/src/lib/i18n/en.json
@@ -32,6 +32,12 @@
"source": "Source",
"donate": "Donate",
"instance": "Instance"
+ },
+ "commands": {
+ "prompt": "Command Prompt",
+ "recents": "Recents",
+ "content": "Content",
+ "search": "Search for {{default}}"
}
},
"account": {
diff --git a/src/routes/post/[instance]/[id=integer]/+page.svelte b/src/routes/post/[instance]/[id=integer]/+page.svelte
index ca8e14ce..0e94994e 100644
--- a/src/routes/post/[instance]/[id=integer]/+page.svelte
+++ b/src/routes/post/[instance]/[id=integer]/+page.svelte
@@ -64,16 +64,17 @@
})
}
- $resumables = [
- ...$resumables,
- {
- id: Math.floor(Math.random() * 1000000),
- name: post.post_view.post.name,
- type: 'post',
- url: $page.url.toString(),
- avatar: post.post_view.post.thumbnail_url,
- },
- ]
+ if (!$resumables.find((r) => r.url == $page.url.toString()))
+ $resumables = [
+ ...$resumables,
+ {
+ id: Math.floor(Math.random() * 1000000),
+ name: post.post_view.post.name,
+ type: 'post',
+ url: $page.url.toString(),
+ avatar: post.post_view.post.thumbnail_url,
+ },
+ ]
})
afterNavigate(async () => {