Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: can not refetch when request parameters changed #35

Merged
merged 1 commit into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions console/src/components/AgreementsModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,17 @@ const { isLoading, mutate } = useMutation({
</script>

<template>
<VModal v-model:visible="visible" mount-to-body title="条款与协议">
<VModal v-model:visible="visible" title="条款与协议">
<p class="as-mb-6 as-text-sm as-text-gray-500">
为了更好的保护您的权益,请在使用 Halo 应用市场前,仔细阅读并同意以下条款与协议。
</p>
<FormKit id="agreements-form" type="form" name="agreements-form" @submit="mutate">
<FormKit v-model="formState.termsOfService" type="checkbox">
<template #label>
<span class="formkit-label formkit-invalid:text-red-500 as-block as-text-sm as-font-medium as-text-gray-700">
我已阅读并同意:<a href="https://www.halo.run/terms-of-service" target="_blank">《Halo 应用市场服务条款》</a>
我已阅读并同意:<a href="https://www.halo.run/terms-of-service" target="_blank">
《Halo 应用市场服务条款》
</a>
</span>
</template>
</FormKit>
Expand Down
10 changes: 2 additions & 8 deletions console/src/components/AppStoreTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import AppDetailModal from "./AppDetailModal.vue";
import { nextTick } from "vue";
import type { ApplicationSearchResult, ListResponse } from "@/types";
import storeApiClient from "@/utils/store-api-client";
import { useElementVisibility } from "@vueuse/core";
import { computed } from "vue";
import AgreementsModal from "./AgreementsModal.vue";

const props = withDefaults(
Expand All @@ -45,9 +43,6 @@ const viewTypes = [

const viewType = useLocalStorage<string>("app-store-tab-list-view", "list");

const tabWrapper = ref<HTMLElement | null>(null);
const tabWrapperIsVisible = useElementVisibility(tabWrapper);

const keyword = ref("");
const page = ref(1);
const size = ref(20);
Expand Down Expand Up @@ -76,7 +71,6 @@ const { data, isFetching, isLoading, refetch } = useQuery<ListResponse<Applicati
page.value = data.page;
size.value = data.size;
},
enabled: computed(() => tabWrapperIsVisible.value),
});

// detail modal
Expand Down Expand Up @@ -130,7 +124,7 @@ watch([selectedPriceMode, selectedSort, keyword], () => {
</script>

<template>
<div ref="tabWrapper">
<div>
<div class="as-block as-w-full as-rounded as-bg-gray-50 as-px-3 as-py-2">
<div class="as-relative as-flex as-flex-col as-items-start sm:as-flex-row sm:as-items-center">
<div class="as-flex as-w-full as-flex-1 as-items-center sm:as-w-auto">
Expand Down Expand Up @@ -243,5 +237,5 @@ watch([selectedPriceMode, selectedSort, keyword], () => {
</template>
</AppDetailModal>

<AgreementsModal v-if="data" />
<AgreementsModal />
</template>