Skip to content

Commit 1f7268f

Browse files
authoredMay 2, 2024··
feat(ui): sort items by file name (#5652)
1 parent bdce0a2 commit 1f7268f

File tree

1 file changed

+5
-1
lines changed
  • packages/ui/client/composables/client

1 file changed

+5
-1
lines changed
 

‎packages/ui/client/composables/client/index.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,13 @@ export const client = (function createVitestClient() {
4242
}
4343
})()
4444

45+
function sort(a: File, b: File) {
46+
return a.name.localeCompare(b.name)
47+
}
48+
4549
export const config = shallowRef<ResolvedConfig>({} as any)
4650
export const status = ref<WebSocketStatus>('CONNECTING')
47-
export const files = computed(() => client.state.getFiles())
51+
export const files = computed(() => client.state.getFiles().sort(sort))
4852
export const current = computed(() => files.value.find(file => file.id === activeFileId.value))
4953
export const currentLogs = computed(() => getTasks(current.value).map(i => i?.logs || []).flat() || [])
5054

0 commit comments

Comments
 (0)
Please sign in to comment.