Skip to content

Commit 8734e4f

Browse files
authored
fix: remove the today option from top filter (#1148)
1 parent 15fbb74 commit 8734e4f

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

src/pages/home/index.vue

+3-6
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
style="margin-top: 40px"
4444
>
4545
<div
46-
v-for="a in [`Today`, `This week`, `This month`, `This year`, `All time`]"
46+
v-for="a in [`This week`, `This month`, `This year`, `All time`]"
4747
:key="a"
4848
class="hotzone flex justify-start items-start flex-col dark:text-gray3"
4949
>
@@ -160,7 +160,7 @@ interface IData {
160160
currentOffset: number
161161
limit: number
162162
noMorePosts: boolean
163-
topAlgorithm: `Today` | `This week` | `This month` | `This year` | `All time`
163+
topAlgorithm: `This week` | `This month` | `This year` | `All time`
164164
showAlgorithmDropdown: boolean
165165
}
166166
@@ -318,7 +318,7 @@ export default Vue.extend({
318318
}
319319
}
320320
},
321-
setTopAlgorithm(a: `Today` | `This week` | `This month` | `This year` | `All time`) {
321+
setTopAlgorithm(a: `This week` | `This month` | `This year` | `All time`) {
322322
this.topAlgorithm = a
323323
this.showAlgorithmDropdown = false
324324
this.$store.commit(`settings/setLastActiveTopAlgorithm`, this.topAlgorithm)
@@ -328,9 +328,6 @@ export default Vue.extend({
328328
convertTimeframe() {
329329
let timeframe: undefined | `1` | `7` | `30` | `365` = `1`
330330
switch (this.topAlgorithm) {
331-
case `Today`:
332-
timeframe = `1`
333-
break
334331
case `This week`:
335332
timeframe = `7`
336333
break

src/store/settings.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export interface SettingState {
1111
recentlyInSettings: boolean
1212
lastActivePost: string
1313
lastActivePostOffset: number
14-
lastTopAlgorithm: `Today` | `This week` | `This month` | `This year` | `All time`
14+
lastTopAlgorithm: `This week` | `This month` | `This year` | `All time`
1515
showUnauthPopup: boolean
1616
}
1717

@@ -45,7 +45,7 @@ export const mutations: MutationTree<SettingState> = {
4545
},
4646
[MutationType.SET_LAST_ACTIVE_TOP_ALGORITHM]: (
4747
state,
48-
algorithm: `Today` | `This week` | `This month` | `This year` | `All time`,
48+
algorithm: `This week` | `This month` | `This year` | `All time`,
4949
) => {
5050
state.lastTopAlgorithm = algorithm
5151
},

0 commit comments

Comments
 (0)