enhance(frontend): improve some caches

This commit is contained in:
syuilo
2023-09-11 14:55:18 +09:00
parent cd6428715e
commit 25e030a707
8 changed files with 23 additions and 68 deletions

View File

@@ -28,18 +28,17 @@ SPDX-License-Identifier: AGPL-3.0-only
</template>
<script lang="ts" setup>
import { onActivated } from 'vue';
import MkButton from '@/components/MkButton.vue';
import { i18n } from '@/i18n';
import { definePageMetadata } from '@/scripts/page-metadata';
import { antennasCache } from '@/cache';
import { api } from '@/os';
import { onActivated } from 'vue';
import { infoImageUrl } from '@/instance';
const antennas = $computed(() => antennasCache.value.value ?? []);
function fetch() {
antennasCache.fetch(() => api('antennas/list'));
antennasCache.fetch();
}
fetch();
@@ -62,7 +61,7 @@ definePageMetadata({
});
onActivated(() => {
antennasCache.fetch(() => api('antennas/list'));
antennasCache.fetch();
});
</script>