Skip to content

Commit

Permalink
more speed improvements (probably)
Browse files Browse the repository at this point in the history
  • Loading branch information
3vorp committed May 4, 2024
1 parent 2ba7ed0 commit 40acca5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion js/addons/addon-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export default {
return this.resultCount === 1 ? "result" : "results";
}
},
mounted() {
created() {
fetch('https://api.faithfulpack.net/v2/addons/approved')
.then((res) => res.json())
.then((data) => {
Expand Down
8 changes: 2 additions & 6 deletions js/download/download-line.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ export default {
data() {
return {
showIcon: "➕",
isMounted: false,
}
},
methods: {
Expand Down Expand Up @@ -115,7 +114,7 @@ export default {
return this.item.file_type + this.item.file_version
},
date() {
if (!this.isMounted || this.item.file_type === "GitHub") return
if (this.item.file_type === "GitHub") return
if (this.item.date)
return this.getLocalizedDate(new Date(this.item.date));

Expand All @@ -124,14 +123,11 @@ export default {
return this.getLocalizedDate(new Date(this.curse.uploaded_at.split("T")[0]));
},
size() {
if (!this.isMounted || this.item.file_type === "GitHub") return
if (this.item.file_type === "GitHub") return
// some very old downloads have manual sizes
if (this.item.size) return this.item.size
if (!this.curse || !this.curse.filesize) return "Unknown"
return `${(this.curse.filesize / 1000000).toFixed(2)} MB`
},
},
mounted() {
this.isMounted = true
}
}
3 changes: 1 addition & 2 deletions js/download/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ document.addEventListener("DOMContentLoaded", () => {
<h2 class="text-center display-4 mb-0">Discontinued</h2>
<template v-for="(data, name) in discontinued" :key="name">
<h2 class="text-center">{{ name }}</h2>
<h2 class="red banner">This project has been discontinued.</h2>
<download-table
:downloads="data.downloads"
:files="data.files"
Expand All @@ -76,7 +75,7 @@ document.addEventListener("DOMContentLoaded", () => {
else this.alive[name][edition].downloads = downloads;
})
.catch(console.error)
fetch(`https://api.allorigins.win/raw?url=${encodeURIComponent(`https://api.cfwidget.com/${curse}`)}`)
fetch(`https://api.cfwidget.com/${curse}`)
.then((res) => res.json())
.then(({ files }) => {
if (discontinued) this.discontinued[name].files = files;
Expand Down

0 comments on commit 40acca5

Please sign in to comment.