From bd60d3c83808b6b15cf18f549e6a9ef544008f5e Mon Sep 17 00:00:00 2001 From: Svallinn <41585298+Svallinn@users.noreply.github.com> Date: Tue, 11 May 2021 16:28:26 +0100 Subject: [PATCH] Top-Nav: Fix undefined/misplaced references --- src/renderer/components/top-nav/top-nav.js | 7 ++++++- src/renderer/store/modules/utils.js | 11 ++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/renderer/components/top-nav/top-nav.js b/src/renderer/components/top-nav/top-nav.js index ab155a5af..92f28af4d 100644 --- a/src/renderer/components/top-nav/top-nav.js +++ b/src/renderer/components/top-nav/top-nav.js @@ -1,4 +1,5 @@ import Vue from 'vue' +import { mapActions } from 'vuex' import FtInput from '../ft-input/ft-input.vue' import FtSearchFilters from '../ft-search-filters/ft-search-filters.vue' import FtProfileSelector from '../ft-profile-selector/ft-profile-selector.vue' @@ -255,6 +256,10 @@ export default Vue.extend({ createNewWindow: function () { ipcRenderer.send('createNewWindow') - } + }, + + ...mapActions([ + 'showToast' + ]) } }) diff --git a/src/renderer/store/modules/utils.js b/src/renderer/store/modules/utils.js index 5223a37ce..794f56ab2 100644 --- a/src/renderer/store/modules/utils.js +++ b/src/renderer/store/modules/utils.js @@ -239,7 +239,7 @@ const actions = { return extractors.reduce((a, c) => a || c(), null) || paramsObject }, - getYoutubeUrlInfo (_, urlStr) { + getYoutubeUrlInfo ({ state }, urlStr) { // Returns // - urlType [String] `video`, `playlist` // @@ -332,11 +332,12 @@ const actions = { const searchQuery = url.searchParams.get('search_query') url.searchParams.delete('search_query') + const searchSettings = state.searchSettings const query = { - sortBy: this.searchSettings.sortBy, - time: this.searchSettings.time, - type: this.searchSettings.type, - duration: this.searchSettings.duration + sortBy: searchSettings.sortBy, + time: searchSettings.time, + type: searchSettings.type, + duration: searchSettings.duration } for (const [param, value] of url.searchParams) {