mirror of
https://github.com/sigmasternchen/threadule
synced 2025-03-15 08:09:01 +00:00
feat: set ordinal for tweets correctly
(maybe do this in backend instead #improvement)
This commit is contained in:
parent
bed63fc923
commit
046a9fb12a
2 changed files with 6 additions and 0 deletions
|
@ -11,6 +11,7 @@ type Tweet = {
|
|||
status: TweetStatus,
|
||||
tweet_id: number|null,
|
||||
error: string|null
|
||||
ordinal: number
|
||||
}
|
||||
|
||||
export default Tweet
|
|
@ -168,6 +168,7 @@ const Index: FunctionComponent<ThreadFormProps> = (
|
|||
text: "",
|
||||
status: TweetStatus.SCHEDULED,
|
||||
tweet_id: null,
|
||||
ordinal: 0,
|
||||
error: null
|
||||
})
|
||||
setThread({
|
||||
|
@ -196,6 +197,10 @@ const Index: FunctionComponent<ThreadFormProps> = (
|
|||
setError("Tweets can't be longer than 280 characters!")
|
||||
return
|
||||
}
|
||||
thread.tweets.forEach((tweet, index) => {
|
||||
tweet.ordinal = index
|
||||
})
|
||||
|
||||
setError(null)
|
||||
onSubmit(thread)
|
||||
}} color="primary">
|
||||
|
|
Loading…
Reference in a new issue