Skip to content

Commit

Permalink
sort antennas and lists in frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
aliceif committed Oct 15, 2024
1 parent b99e13e commit 0c9f1f0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/frontend/src/pages/my-antennas/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import { definePageMetadata } from '@/scripts/page-metadata.js';
import { antennasCache } from '@/cache.js';
import { infoImageUrl } from '@/instance.js';

const antennas = computed(() => antennasCache.value.value ?? []);
const antennas = computed(() => (antennasCache.value.value ?? []).sort((x, y) => x.name.localeCompare(y.name)));

function fetch() {
antennasCache.fetch();
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/pages/my-lists/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import { signinRequired } from '@/account.js';

const $i = signinRequired();

const items = computed(() => userListsCache.value.value ?? []);
const items = computed(() => (userListsCache.value.value ?? []).sort((x, y) => x.name.localeCompare(y.name)));

function fetch() {
userListsCache.fetch();
Expand Down
4 changes: 2 additions & 2 deletions packages/frontend/src/pages/timeline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ function top(): void {
}

async function chooseList(ev: MouseEvent): Promise<void> {
const lists = await userListsCache.fetch();
const lists = (await userListsCache.fetch()).sort((x, y) => x.name.localeCompare(y.name));
const items: MenuItem[] = [
...lists.map(list => ({
type: 'link' as const,
Expand All @@ -154,7 +154,7 @@ async function chooseList(ev: MouseEvent): Promise<void> {
}

async function chooseAntenna(ev: MouseEvent): Promise<void> {
const antennas = await antennasCache.fetch();
const antennas = (await antennasCache.fetch()).sort((x, y) => x.name.localeCompare(y.name));
const items: MenuItem[] = [
...antennas.map(antenna => ({
type: 'link' as const,
Expand Down

0 comments on commit 0c9f1f0

Please sign in to comment.