From 7f68d2bf7976d5afdbc7effb21e4bd25b91efb6a Mon Sep 17 00:00:00 2001 From: Kevin Midboe Date: Tue, 26 Jul 2022 00:21:37 +0200 Subject: [PATCH] Border radius & prevent display result count before vaule --- src/components/Movie.vue | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/src/components/Movie.vue b/src/components/Movie.vue index 0b1949f..91ae5df 100644 --- a/src/components/Movie.vue +++ b/src/components/Movie.vue @@ -61,7 +61,9 @@ > Search for torrents - {{ numberOfTorrentResults }} + {{ + numberOfTorrentResults + }} @@ -255,20 +257,19 @@ export default { } }, methods: { - fetchByType() { - if (this.type === "movie") { - getMovie(this.id, true, false) - .then(this.parseResponse) - .catch(error => { - this.$router.push({ name: "404" }); - }); - } else if (this.type == "show") { - getShow(this.id, false, false) - .then(this.parseResponse) - .catch(error => { - this.$router.push({ name: "404" }); - }); - } else { + async fetchByType() { + try { + let response; + if (this.type === "movie") { + response = await getMovie(this.id, true, false); + } else if (this.type === "show") { + response = await getShow(this.id, false, false); + } else { + this.$router.push({ name: "404" }); + } + + this.parseResponse(response); + } catch (error) { this.$router.push({ name: "404" }); } @@ -334,7 +335,7 @@ export default { } }, created() { - store.dispatch("torrentModule/setResultCount", 0); + store.dispatch("torrentModule/setResultCount", null); this.prevDocumentTitle = store.getters["documentTitle/title"]; this.fetchByType(); }, @@ -405,6 +406,7 @@ header { > img { width: 100%; + border-radius: 10px; } } }