Skip to content

Commit

Permalink
Fixing FlowJS typing
Browse files Browse the repository at this point in the history
There's probably still an issue with react-timeago not being properly
ignored yet.

See #2350
  • Loading branch information
matiasgarciaisaia committed Nov 5, 2024
1 parent 59e67b7 commit 20d0720
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion assets/js/actions/survey.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ export const deleteLink = (link: Link) => ({
link,
})

export const generatingFile = (file: String) => ({
export const generatingFile = (file: string) => ({
type: GENERATING_FILE,
file
})
Expand Down
5 changes: 3 additions & 2 deletions assets/js/components/respondents/RespondentIndex.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,11 @@ type Props = {
q: string,
fields: Array<Object>,
selectedFields: Array<string>,
respondentsFiles: { files: SurveyFiles },
}

type State = {
shownFile: string,
shownFile: ?string,
filesFetchTimer: ?IntervalID,
}

Expand Down Expand Up @@ -485,7 +486,7 @@ class RespondentIndex extends Component<Props, State> {

const downloadButtonClass = fileExists ? "black-text" : "grey-text"
const downloadButtonOnClick = fileExists ? item.onDownload : null
const createdAtLabel = fileExists ? <TimeAgo date={fileStatus.created_at * 1000} formatter={this.timeFormatter} /> : null
const createdAtLabel = fileExists ? <TimeAgo date={(fileStatus?.created_at || 0) * 1000} formatter={this.timeFormatter} /> : null

const fileCreating = !!fileStatus?.creating
const generateButtonClass = fileCreating ? "btn-icon-grey" : "black-text"
Expand Down
2 changes: 1 addition & 1 deletion assets/js/decls/survey.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export type Response = {
export type Disposition = null | "completed" | "partial" | "ineligible"

export type FileStatus = {
created_at: Date?,
created_at: ?Date,
creating: boolean,
file_type: string,
}
Expand Down

0 comments on commit 20d0720

Please sign in to comment.