-
Notifications
You must be signed in to change notification settings - Fork 902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issue 6194 #6627
base: development
Are you sure you want to change the base?
Fix issue 6194 #6627
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ import { | |
} from '../../helpers/utils' | ||
|
||
const state = { | ||
topNavInstance: null, | ||
isSideNavOpen: false, | ||
outlinesHidden: true, | ||
sessionSearchHistory: [], | ||
|
@@ -65,6 +66,10 @@ const state = { | |
} | ||
|
||
const getters = { | ||
getTopNavInstance(state) { | ||
return state.topNavInstance | ||
}, | ||
Comment on lines
+69
to
+71
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue: Storing a reference to the instance in state is an antipattern and should be avoided. One way to do this instead would be to |
||
|
||
getIsSideNavOpen(state) { | ||
return state.isSideNavOpen | ||
}, | ||
|
@@ -280,6 +285,23 @@ const actions = { | |
} | ||
}, | ||
|
||
applyFilters({ state, rootGetters }, { queryText, searchSettings }) { | ||
const topNavInstance = rootGetters.getTopNavInstance | ||
if (topNavInstance && topNavInstance.goToSearch) { | ||
topNavInstance.goToSearch(queryText, { searchSettings }) | ||
} else { | ||
console.error('Unable to find goToSearch method in top-nav instance.') | ||
} | ||
this.dispatch('hideSearchFilters') | ||
}, | ||
performSearch({ state }) { | ||
const searchSettings = state.searchSettings | ||
const queryText = state.sessionSearchHistory.length | ||
? state.sessionSearchHistory[0].query | ||
: '' | ||
this.dispatch('goToSearch', { queryText, searchSettings }) | ||
}, | ||
|
||
parseScreenshotCustomFileName: function({ rootState }, payload) { | ||
const { pattern = rootState.settings.screenshotFilenamePattern, date, playerTime, videoId } = payload | ||
const keywords = [ | ||
|
@@ -805,6 +827,10 @@ const actions = { | |
} | ||
|
||
const mutations = { | ||
setTopNavInstance(state, instance) { | ||
state.topNavInstance = instance | ||
}, | ||
|
||
toggleSideNav (state) { | ||
state.isSideNavOpen = !state.isSideNavOpen | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -116,6 +116,8 @@ Search Filters: | |
Location: Location | ||
HDR: HDR | ||
VR180: VR180 | ||
Apply: 'Apply' | ||
Close: 'Close' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue: This |
||
# On Search Page | ||
Search Results: Search Results | ||
Fetching results. Please wait: Fetching results. Please wait | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should not be needed after aforementioned unused key is removed.