2021-01-14 22:53:01 +01:00
|
|
|
import { createRef } from 'react'
|
|
|
|
import { ComposeState } from './types'
|
2020-12-30 00:56:25 +01:00
|
|
|
|
2021-02-07 00:39:11 +01:00
|
|
|
const composeInitialState: Omit<ComposeState, 'timestamp'> = {
|
|
|
|
dirty: false,
|
2021-01-14 22:53:01 +01:00
|
|
|
posting: false,
|
2020-12-30 00:56:25 +01:00
|
|
|
spoiler: {
|
|
|
|
active: false,
|
|
|
|
count: 0,
|
|
|
|
raw: '',
|
|
|
|
formatted: undefined,
|
|
|
|
selection: { start: 0, end: 0 }
|
|
|
|
},
|
|
|
|
text: {
|
|
|
|
count: 0,
|
|
|
|
raw: '',
|
|
|
|
formatted: undefined,
|
|
|
|
selection: { start: 0, end: 0 }
|
|
|
|
},
|
|
|
|
tag: undefined,
|
|
|
|
emoji: { active: false, emojis: undefined },
|
|
|
|
poll: {
|
|
|
|
active: false,
|
|
|
|
total: 2,
|
|
|
|
options: {
|
|
|
|
'0': undefined,
|
|
|
|
'1': undefined,
|
|
|
|
'2': undefined,
|
|
|
|
'3': undefined
|
|
|
|
},
|
|
|
|
multiple: false,
|
|
|
|
expire: '86400'
|
|
|
|
},
|
2021-05-17 23:33:07 +02:00
|
|
|
attachments: {
|
|
|
|
sensitive: false,
|
|
|
|
uploads: []
|
|
|
|
},
|
2020-12-30 00:56:25 +01:00
|
|
|
visibility: 'public',
|
|
|
|
visibilityLock: false,
|
|
|
|
replyToStatus: undefined,
|
|
|
|
textInputFocus: {
|
|
|
|
current: 'text',
|
2021-04-09 21:43:12 +02:00
|
|
|
refs: { text: createRef() }
|
2020-12-30 00:56:25 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default composeInitialState
|