From 4a46bbd2be111d7a761a1713341fa9937fb369bb Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Tue, 22 Oct 2019 23:34:54 +0200 Subject: [PATCH] Movie now uses the new documentTitle module to set when loading movie and when popover dismissed we set it to the previous documenTitle. Created a getter for documentTitle. This makes it easier to only get the title variable and not try save and parse the document title with all the extra prefixes --- src/components/Movie.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Movie.vue b/src/components/Movie.vue index c5de83b..872cafd 100644 --- a/src/components/Movie.vue +++ b/src/components/Movie.vue @@ -120,7 +120,7 @@ import img from '@/directives/v-image.js' import TorrentList from './TorrentList.vue' import Person from './Person.vue' import SidebarListElement from './ui/sidebarListElem.vue' -import store from '@/store.js' +import store from '@/store' import LoadingPlaceholder from './ui/LoadingPlaceholder.vue' import { getMovie, getShow, request, getRequestStatus } from '@/api.js' @@ -156,7 +156,7 @@ export default { this.checkIfRequested(movie) .then(status => this.requested = status) - document.title = movie.title + storage.pageTitlePostfix + store.dispatch('documentTitle/updateTitle', movie.title) }, async checkIfRequested(movie) { return await getRequestStatus(movie.id, movie.type) @@ -195,10 +195,10 @@ export default { } }, beforeDestroy() { - document.title = this.prevDocumentTitle + store.dispatch('documentTitle/updateTitle', this.prevDocumentTitle) }, created(){ - this.prevDocumentTitle = document.title + this.prevDocumentTitle = store.getters['documentTitle/title'] if (this.type === 'movie') { getMovie(this.id)