1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Rewrite header actions

This commit is contained in:
Zhiyuan Zheng
2020-12-19 18:21:37 +01:00
parent 54799aabb8
commit 98a60df9d1
9 changed files with 152 additions and 104 deletions

View File

@ -179,6 +179,7 @@ const composeExistingState = ({
}): ComposeState => {
switch (type) {
case 'edit':
console.log(incomingStatus)
return {
...composeInitialState,
...(incomingStatus.spoiler_text?.length && {
@ -201,10 +202,10 @@ const composeExistingState = ({
active: true,
total: incomingStatus.poll.options.length,
options: {
'0': incomingStatus.poll.options[0].title || undefined,
'1': incomingStatus.poll.options[1].title || undefined,
'2': incomingStatus.poll.options[2].title || undefined,
'3': incomingStatus.poll.options[3].title || undefined
'0': incomingStatus.poll.options[0]?.title || undefined,
'1': incomingStatus.poll.options[1]?.title || undefined,
'2': incomingStatus.poll.options[2]?.title || undefined,
'3': incomingStatus.poll.options[3]?.title || undefined
},
multiple: incomingStatus.poll.multiple,
expire: '86400' // !!!