Skip to content

Commit f249242

Browse files
authored
fix(TasksPage): remove showInactive setState from constructor (#4977)
1 parent c4f5fdf commit f249242

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

src/tasks/actions/thunks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export const getAllTasks = (name?: string) => async (
125125
const resp = await fetchTasks(query)
126126

127127
let nonNormalizedTasks = resp.data.tasks
128-
let next = resp.data.links.next
128+
let next = resp.data?.links?.next
129129
while (next && next.includes('after=')) {
130130
const afterAndExtras = next.split('after=')
131131
if (afterAndExtras.length < 2) {

src/tasks/containers/TasksPage.test.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import TasksPage from './TasksPage'
1414
import {deleteTask, patchTask, postTask, getTask} from 'src/client'
1515
import {parse} from 'src/languageSupport/languages/flux/parser'
1616
import {mocked} from 'ts-jest/utils'
17+
import {initialState} from 'src/tasks/reducers/helpers'
1718

1819
const sampleScript =
1920
'option task = {\n name: "beetle",\n every: 1h,\n}\n' +
@@ -151,6 +152,7 @@ const setup = (override = {}) => {
151152
status: RemoteDataState.Done,
152153
},
153154
tasks: {
155+
...initialState(),
154156
byID: {
155157
[localTasks[0].id]: localTasks[0],
156158
[localTasks[1].id]: localTasks[1],

src/tasks/containers/TasksPage.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,6 @@ class TasksPage extends PureComponent<Props, State> {
6767
constructor(props: Props) {
6868
super(props)
6969

70-
if (!props.showInactive) {
71-
props.setShowInactive()
72-
}
73-
7470
this.state = {
7571
isImporting: false,
7672
taskLabelsEdit: null,

0 commit comments

Comments
 (0)