Skip to content

Commit 30523b9

Browse files
committed
Merge #710: update dependencies and fix type errors
c884ccd update dependencies and fix type errors (Graeme Byrne) Pull request description: ## Summary This PR updates project dependencies to their latest compatible versions, ensuring that the project still builds and runs correctly. Care was taken to avoid versions that introduced breaking changes (e.g., Nuxt 3.17.4, which caused runtime errors). ## Changes - Updated `nuxt` and related dependencies to stable versions that do not break the project - Resolved type errors across the codebase introduced by dependency updates ACKs for top commit: josecelano: ACK c884ccd Tree-SHA512: e138e1cfc0e278d907b57dc053ca0b6f40ce58b1dd0aa0afe1f77469157e417e4ddd6abc7a17739a03a675cc925a19c8f631515ab801791892ef369f3d350a19
2 parents 6d7a621 + c884ccd commit 30523b9

32 files changed

+10754
-7819
lines changed

components/Markdown.vue

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ const sanitizedDescription = ref("");
2020
2121
const options = {
2222
headerIds: false,
23-
mangle: false
23+
mangle: false,
24+
async: true
2425
};
2526
2627
const source = computed(() => props.source);
@@ -33,12 +34,12 @@ onMounted(() => {
3334
sanitizeDescription();
3435
});
3536
36-
function convert_markdown_to_html (src: string) {
37-
return marked(src, options);
37+
async function convert_markdown_to_html (src: string): Promise<string> {
38+
return await marked(src, options);
3839
}
3940
4041
async function sanitizeDescription () {
41-
const html = convert_markdown_to_html(props.source);
42+
const html = await convert_markdown_to_html(props.source); // await here
4243
sanitizedDescription.value = await sanitize(html);
4344
}
4445
</script>

components/Pagination.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div class="flex flex-col items-center justify-end flex-1 gap-3 md:flex-row sm:justify-between">
44
<div class="flex items-center gap-3">
55
<div>
6-
<select :value="pageSize" class="px-2 py-1 bg-base-100" @change="(e) => updatePageSize(parseInt(e.target.value, 10))">
6+
<select :value="pageSize" class="px-2 py-1 bg-base-100" @change="(e) => updatePageSize(parseInt((e.target as HTMLSelectElement).value, 10))">
77
<option value="20">
88
20
99
</option>

components/authentication/AuthenticationForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ async function login () {
6262
navigateTo("/torrents", { replace: true });
6363
}
6464
})
65-
.catch((err) => {
65+
.catch((err: Error) => {
6666
notify({
6767
group: "error",
6868
title: "Error",

components/license/License.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div>
3-
<Markdown :source="file" class="prose-h1:text-center pt-2 pb-10 pb-5 px-40 max-w-none" />
3+
<Markdown :source="file" class="prose-h1:text-center pt-2 pb-5 px-40 max-w-none" />
44
</div>
55
</template>
66
<script setup lang="ts">

components/navigation/NavigationBar.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ const user = useUser();
8181
8282
const mobileCollapsed = ref(true);
8383
84+
// Define the submitSearch function
85+
function submitSearch () {
86+
// Add your search logic here
87+
}
8488
</script>
8589

8690
<style scoped>

components/registration/RegistrationForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ function signup () {
108108
text: "Your account was registered!"
109109
}, 4000); // 4s
110110
})
111-
.catch((err) => {
111+
.catch((err: Error) => {
112112
notify({
113113
group: "error",
114114
title: "Error",

components/torrent/TorrentActionCard.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ function deleteTorrent () {
194194
.then(() => {
195195
emit("deleted");
196196
})
197-
.catch((err) => {
197+
.catch((err: Error) => {
198198
notify({
199199
group: "error",
200200
title: "Error",

components/torrent/TorrentCreationDateTab.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ const props = defineProps({
4040
}
4141
});
4242
43-
const formattedDateFromTimestamp = formatTimestamp(props.torrent.creation_date);
43+
const formattedDateFromTimestamp = (() => {
44+
const result = formatTimestamp(props.torrent.creation_date);
45+
return result instanceof Error ? "Invalid date" : result;
46+
})();
4447
4548
</script>
4649

components/torrent/TorrentDetails.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ function getTorrentFromApi (infoHash: string) {
8080
loadingTorrent.value = true;
8181
8282
rest.torrent.getTorrentInfo(infoHash)
83-
.then((data) => {
83+
.then((data: TorrentResponse) => {
8484
torrent.value = data;
8585
title.value = data.title;
8686
})
87-
.catch((err) => {
87+
.catch((err: Error) => {
8888
loadingTorrent.value = false;
8989
notify({
9090
group: "error",

components/torrent/TorrentTable.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="flex flex-col w-full overflow-hidden rounded-lg border-base-content/20 rounded-2xl grow">
2+
<div class="flex flex-col w-full overflow-hidden border-base-content/20 rounded-2xl grow">
33
<div class="flex flex-col overflow-x-auto whitespace-nowrap">
44
<table class="text-center table-auto bg-base-200">
55
<thead>

0 commit comments

Comments
 (0)