2019-12-20 13:04:34 +01:00
|
|
|
<template>
|
2022-07-12 10:55:28 +02:00
|
|
|
<div class="container mx-auto px-2">
|
|
|
|
<h1>{{ t("Privacy Policy") }}</h1>
|
2021-03-26 19:27:51 +01:00
|
|
|
<div
|
2022-07-12 10:55:28 +02:00
|
|
|
class="prose dark:prose-invert"
|
|
|
|
v-if="config?.privacy"
|
2021-03-26 19:27:51 +01:00
|
|
|
v-html="config.privacy.bodyHtml"
|
|
|
|
/>
|
2020-02-18 08:57:00 +01:00
|
|
|
</div>
|
2019-12-20 13:04:34 +01:00
|
|
|
</template>
|
|
|
|
|
2022-07-12 10:55:28 +02:00
|
|
|
<script lang="ts" setup>
|
2020-06-19 19:27:10 +02:00
|
|
|
import { PRIVACY } from "@/graphql/config";
|
2020-02-18 08:57:00 +01:00
|
|
|
import { IConfig } from "@/types/config.model";
|
2020-11-27 19:27:44 +01:00
|
|
|
import { InstancePrivacyType } from "@/types/enums";
|
2022-07-12 10:55:28 +02:00
|
|
|
import { useQuery } from "@vue/apollo-composable";
|
|
|
|
import { computed, watch } from "vue";
|
|
|
|
import { useI18n } from "vue-i18n";
|
2019-12-20 13:04:34 +01:00
|
|
|
|
2022-07-12 10:55:28 +02:00
|
|
|
const { locale } = useI18n({ useScope: "global" });
|
2020-02-18 08:57:00 +01:00
|
|
|
|
2022-07-12 10:55:28 +02:00
|
|
|
const { result: configResult } = useQuery<{ config: IConfig }>(
|
|
|
|
PRIVACY,
|
|
|
|
() => ({
|
2022-11-29 08:17:58 +01:00
|
|
|
locale: locale,
|
2022-07-12 10:55:28 +02:00
|
|
|
}),
|
|
|
|
() => ({
|
2022-11-29 08:17:58 +01:00
|
|
|
enabled: locale !== undefined,
|
2022-07-12 10:55:28 +02:00
|
|
|
})
|
|
|
|
);
|
2019-12-20 13:04:34 +01:00
|
|
|
|
2022-07-12 10:55:28 +02:00
|
|
|
const config = computed(() => configResult.value?.config);
|
2019-12-20 13:04:34 +01:00
|
|
|
|
2022-07-12 10:55:28 +02:00
|
|
|
const { t } = useI18n({ useScope: "global" });
|
2019-12-20 13:04:34 +01:00
|
|
|
|
2022-07-12 10:55:28 +02:00
|
|
|
// metaInfo() {
|
|
|
|
// return {
|
|
|
|
// title: this.t("Privacy Policy") as string,
|
|
|
|
// };
|
|
|
|
// },
|
2020-06-19 19:27:10 +02:00
|
|
|
|
2022-07-12 10:55:28 +02:00
|
|
|
watch(config, () => {
|
|
|
|
if (config.value?.privacy?.type === InstancePrivacyType.URL) {
|
|
|
|
window.location.replace(config.value?.privacy?.url);
|
2020-06-19 19:27:10 +02:00
|
|
|
}
|
2022-07-12 10:55:28 +02:00
|
|
|
});
|
|
|
|
</script>
|