-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Sort by date on the history page #6214
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
Changes from 1 commit
a0bdfad
3b6e0c8
ccbce83
eb0d849
c2edd17
caf079b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
…o ascending
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -19,10 +19,7 @@ function filterVideosWithQuery(videos, query, attrProcessor = identity) { | |||||
| } else if (typeof (video.author) === 'string' && attrProcessor(video.author).includes(query)) { | ||||||
| return true | ||||||
| } | ||||||
|
|
||||||
| return false | ||||||
| }).sort((a, b) => { | ||||||
| return b.timeWatched - a.timeWatched | ||||||
| }) | ||||||
| } | ||||||
|
|
||||||
|
|
@@ -44,14 +41,15 @@ export default defineComponent({ | |||||
| dataLimit: 100, | ||||||
| searchDataLimit: 100, | ||||||
| doCaseSensitiveSearch: false, | ||||||
| ascending: false, | ||||||
|
Collaborator
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.
Suggested change
Recommend adjusting the variable name to be more specific.
Author
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. sounds good, I'll change it |
||||||
| showLoadMoreButton: false, | ||||||
| query: '', | ||||||
| activeData: [], | ||||||
| } | ||||||
| }, | ||||||
| computed: { | ||||||
| historyCacheSorted: function () { | ||||||
| return this.$store.getters.getHistoryCacheSorted | ||||||
| return this.ascending ? [...this.$store.getters.getHistoryCacheSorted].reverse() : this.$store.getters.getHistoryCacheSorted | ||||||
|
jlvivero marked this conversation as resolved.
Outdated
|
||||||
| }, | ||||||
|
|
||||||
| fullData: function () { | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,6 +29,13 @@ | |
| :default-value="doCaseSensitiveSearch" | ||
| @change="doCaseSensitiveSearch = !doCaseSensitiveSearch" | ||
| /> | ||
| <ft-toggle-switch | ||
|
Collaborator
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. suggestion (non-blocking): We do tend to use
Member
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. Better have consistent UI unless there is a good reason
Author
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. ft-select will probably require me to make change to the store, not a problem, but I'm debating then, if I'm using ft-select I should stop using a boolean for this then, I didn't want to use an enum yet, since I don't even know if we will have sorting of anything besides date. (and if we are never sorting by anything else an enum feels unnecessary) what are your thoughts on using an enum instead? I can also add boolean as a type to ft-select, but I'm not sure what is the desired approach here |
||
| v-if="fullData.length > 1" | ||
| :label="$t('History.history sort by date ascending/descending')" | ||
| :compact="true" | ||
| :default-value="ascending" | ||
| @change="ascending = !ascending" | ||
| /> | ||
| </div> | ||
| <ft-flex-box | ||
| v-show="fullData.length === 0" | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.