Refactor into useLocalizedData

This commit is contained in:
BlossomiShymae
2024-10-14 19:02:06 -05:00
parent 793cd3e120
commit e956f7f6d1
15 changed files with 43 additions and 103 deletions

View File

@@ -1,12 +1,7 @@
<script setup lang="ts">
const { client } = useClient();
const { currentLocale } = useLocale();
const getSkins = async () => await client.wardSkins.listAsync({locale: currentLocale.value, version: "latest"});
const skins = ref(await getSkins());
watch(currentLocale, async() => {
skins.value = await getSkins();
});
const { data: skins } = await useLocalizedData(async (x) => await client.wardSkins.listAsync({locale: x, version: "latest"}));
const { query, results } = useQueryable(skins, (x) => x.id, (x) => x.name);
</script>