[Glitch] autofocus the compose form again on /share

Port bbcbb2dd7f to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
lolsob-rspec
Akira Ouchi 2023-01-30 22:49:10 +09:00 committed by Claire
parent 90d652c623
commit 84e332a9a1
2 changed files with 3 additions and 3 deletions

View File

@ -9,7 +9,7 @@ export default class Compose extends React.PureComponent {
render () { render () {
return ( return (
<div> <div>
<ComposeFormContainer /> <ComposeFormContainer autoFocus />
<NotificationsContainer /> <NotificationsContainer />
<ModalContainer /> <ModalContainer />
<LoadingBarContainer className='loading-bar' /> <LoadingBarContainer className='loading-bar' />

View File

@ -303,8 +303,8 @@ const insertEmoji = (state, position, emojiData) => {
const hydrate = (state, hydratedState) => { const hydrate = (state, hydratedState) => {
state = clearAll(state.merge(hydratedState)); state = clearAll(state.merge(hydratedState));
if (hydratedState.has('text')) { if (hydratedState.get('text')) {
state = state.set('text', hydratedState.get('text')); state = state.set('text', hydratedState.get('text')).set('focusDate', new Date());
} }
return state; return state;