Browse Source

[Glitch] autofocus the compose form again on /share

Port e73b55184b to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
closed-social-glitch-2
Akira Ouchi 1 year ago
committed by Claire
parent
commit
8ce02aa6e8
2 changed files with 3 additions and 3 deletions
  1. +1
    -1
      app/javascript/flavours/glitch/features/standalone/compose/index.js
  2. +2
    -2
      app/javascript/flavours/glitch/reducers/compose.js

+ 1
- 1
app/javascript/flavours/glitch/features/standalone/compose/index.js View File

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

+ 2
- 2
app/javascript/flavours/glitch/reducers/compose.js View File

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

Loading…
Cancel
Save