From 67af9f2ea2a9903a713bccb4bb825659ce5958a3 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Sat, 20 Mar 2021 03:33:29 +0100 Subject: [PATCH] Using thumbnail width and height for release banner photos. Preventing user page from reloading when closing the add stash dialog without adding stash. --- assets/components/releases/banner.vue | 12 ++++++------ assets/components/stashes/add-stash.vue | 5 +++-- assets/components/users/user.vue | 12 ++++++++++-- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/assets/components/releases/banner.vue b/assets/components/releases/banner.vue index 48b2c689..92e8a322 100644 --- a/assets/components/releases/banner.vue +++ b/assets/components/releases/banner.vue @@ -33,8 +33,8 @@ v-else-if="release.teaser && /^image\//.test(release.teaser.mime)" :src="getPath(release.teaser, 'thumbnail', { original: true })" :alt="release.title" - :width="release.teaser.width" - :height="release.teaser.height" + :width="release.teaser.thumbnailWidth" + :height="release.teaser.thumbnailHeight" loading="lazy" class="item trailer" > @@ -68,8 +68,8 @@
@@ -50,10 +50,17 @@ async function fetchUser() { this.user = await this.$store.dispatch('fetchUser', this.$route.params.username); this.isMe = this.user.id === this.$store.state.auth.user?.id; - this.showAddStash = false; this.pageTitle = this.user?.username; } +async function closeAddStash(addedStash) { + this.showAddStash = false; + + if (addedStash) { + await this.fetchUser(); + } +} + async function mounted() { await this.fetchUser(); } @@ -75,6 +82,7 @@ export default { }, mounted, methods: { + closeAddStash, fetchUser, }, };