diff --git a/resources/js/Pages/Monica/Index.vue b/resources/js/Pages/Monica/Index.vue index 060a9a8..78d94e0 100644 --- a/resources/js/Pages/Monica/Index.vue +++ b/resources/js/Pages/Monica/Index.vue @@ -16,7 +16,7 @@ const props = defineProps({ links: Object, }); -const refresh = ref(_.debounce(() => doRefresh(), 1000)); +const doRefresh = ref(_.debounce(() => onRefresh(), 1000)); const updateForm = useForm({ plan_id: null, }); @@ -24,12 +24,12 @@ const subscribeForm = useForm({}); onMounted(() => { if (props.refresh) { - (refresh.value)(); + (doRefresh.value)(); } }); onUnmounted(() => { - refresh.value.cancel(); + doRefresh.value.cancel(); }); const currentPlan = computed(() => props.current_licence === null ? null : plan(props.current_licence.plan_id)); @@ -38,13 +38,13 @@ const licenceCancelled = computed(() => props.current_licence.subscription_state const plan = (id) => props.plans[props.plans.findIndex((x) => x.id === id)]; -const doRefresh = () => { +const onRefresh = () => { if (usePage().component.value === 'Monica/Index') { router.reload({ only: ['current_licence'], onFinish: () => { if (props.current_licence === null || props.current_licence.subscription_state === 'subscription_cancelled') { - (refresh.value)(); + (doRefresh.value)(); } }, }); diff --git a/resources/js/Pages/OfficeLife/Index.vue b/resources/js/Pages/OfficeLife/Index.vue index ca2ed0e..9354207 100644 --- a/resources/js/Pages/OfficeLife/Index.vue +++ b/resources/js/Pages/OfficeLife/Index.vue @@ -17,7 +17,7 @@ const props = defineProps({ }); const localPlans = ref([]); -const refresh = ref(_.debounce(() => doRefresh(), 1000)); +const doRefresh = ref(_.debounce(() => onRefresh(), 1000)); const updateForm = useForm({ plan_id: null, }); @@ -28,12 +28,12 @@ const subscribeForm = useForm({ onMounted(() => { localPlans.value = props.plans; if (props.refresh) { - (refresh.value)(); + (doRefresh.value)(); } }); onUnmounted(() => { - refresh.value.cancel(); + doRefresh.value.cancel(); }); const currentPlan = computed(() => props.current_licence === null || props.current_licence.subscription_state === 'subscription_cancelled' ? null : plan(props.current_licence.plan_id)); @@ -42,13 +42,13 @@ const licenceCancelled = computed(() => props.current_licence.subscription_state const plan = (id) => localPlans.value[localPlans.value.findIndex((x) => x.id === id)]; -const doRefresh = () => { +const onRefresh = () => { if (usePage().component.value === 'OfficeLife/Index') { router.reload({ only: ['current_licence'], onFinish: () => { if (props.current_licence === null || props.current_licence.subscription_state === 'subscription_cancelled') { - (refresh.value)(); + (doRefresh.value)(); } }, });