Fix terms with no settings
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -25,7 +25,11 @@
|
||||
</div>
|
||||
<div class="column contact">
|
||||
<h4>{{ $t("Contact") }}</h4>
|
||||
<instance-contact-link :contact="config.contact" />
|
||||
<instance-contact-link
|
||||
v-if="config && config.contact"
|
||||
:contact="config.contact"
|
||||
/>
|
||||
<p v-else>{{ $t("No information") }}</p>
|
||||
</div>
|
||||
</section>
|
||||
<hr />
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="container section">
|
||||
<h2 class="title">{{ $t("Privacy Policy") }}</h2>
|
||||
<div class="content" v-html="config.privacy.bodyHtml" />
|
||||
<div class="content" v-if="config" v-html="config.privacy.bodyHtml" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -37,14 +37,14 @@ export default class Privacy extends Vue {
|
||||
|
||||
@Watch("config", { deep: true })
|
||||
watchConfig(config: IConfig): void {
|
||||
if (config.privacy.type) {
|
||||
if (config?.privacy?.type) {
|
||||
this.redirectToUrl();
|
||||
}
|
||||
}
|
||||
|
||||
redirectToUrl(): void {
|
||||
if (this.config.privacy.type === InstancePrivacyType.URL) {
|
||||
window.location.replace(this.config.privacy.url);
|
||||
if (this.config?.privacy?.type === InstancePrivacyType.URL) {
|
||||
window.location.replace(this.config?.privacy?.url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="container section">
|
||||
<h2 class="title">{{ $t("Terms") }}</h2>
|
||||
<div class="content" v-html="config.terms.bodyHtml" />
|
||||
<div class="content" v-if="config" v-html="config.terms.bodyHtml" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -37,14 +37,14 @@ export default class Terms extends Vue {
|
||||
|
||||
@Watch("config", { deep: true })
|
||||
watchConfig(config: IConfig): void {
|
||||
if (config.terms.type) {
|
||||
if (config?.terms?.type) {
|
||||
this.redirectToUrl();
|
||||
}
|
||||
}
|
||||
|
||||
redirectToUrl(): void {
|
||||
if (this.config.terms.type === InstanceTermsType.URL) {
|
||||
window.location.replace(this.config.terms.url);
|
||||
if (this.config?.terms?.type === InstanceTermsType.URL) {
|
||||
window.location.replace(this.config?.terms?.url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user