feat(ui): sort items by file name (#5652)

This commit is contained in:
btea 2024-05-02 22:06:47 +08:00 committed by GitHub
parent bdce0a29db
commit 1f7268fa76
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -42,9 +42,13 @@ export const client = (function createVitestClient() {
}
})()
function sort(a: File, b: File) {
return a.name.localeCompare(b.name)
}
export const config = shallowRef<ResolvedConfig>({} as any)
export const status = ref<WebSocketStatus>('CONNECTING')
export const files = computed(() => client.state.getFiles())
export const files = computed(() => client.state.getFiles().sort(sort))
export const current = computed(() => files.value.find(file => file.id === activeFileId.value))
export const currentLogs = computed(() => getTasks(current.value).map(i => i?.logs || []).flat() || [])