fix: filter servers when listing them

This commit is contained in:
Daniel Roe 2022-12-28 15:03:32 +01:00
parent 5c73a6f98e
commit 377072bea7
No known key found for this signature in database
GPG key ID: 22D5008E4F5D9B55

View file

@ -66,11 +66,9 @@ export async function getApp(server: string) {
}
export async function listServers() {
const keys = await storage.getKeys()
const keys = await storage.getKeys('servers:')
const servers = new Set<string>()
for await (const key of keys) {
if (!key.startsWith('servers:'))
continue
const id = key.split(':').pop()!.replace(/\.json$/, '')
if (id)
servers.add(id.toLocaleLowerCase())