@@ -101,7 +114,7 @@ import {
useTags,
useUser
} from "#imports";
-import { useCategories } from "~/composables/states";
+import { useCategories, useSettings } from "~/composables/states";
type FormUploadTorrent = {
title: string;
@@ -111,11 +124,13 @@ type FormUploadTorrent = {
torrentFile: any;
}
+const settings = useSettings();
const categories = useCategories();
const tags = useTags();
const user = useUser();
const rest = useRestApi();
+const agreeToTerms: Ref = ref(false);
const uploading: Ref = ref(false);
const descriptionView = ref("edit");
const form: Ref = ref({
@@ -125,12 +140,23 @@ const form: Ref = ref({
tags: [],
torrentFile: ""
});
+const contentUploadAgreement = ref("");
onMounted(() => {
getCategories();
getTags();
});
+watch(
+ () => settings.value,
+ (newSettings) => {
+ if (newSettings?.website?.terms?.upload?.content_upload_agreement) {
+ contentUploadAgreement.value = newSettings.website.terms.page.title;
+ }
+ },
+ { immediate: true }
+);
+
function formValid () {
return form.value.title && form.value.category && form.value.torrentFile;
}