From e73b55184b37e7f29e5bcb16c980dc8dbdb9a7d1 Mon Sep 17 00:00:00 2001 From: Akira Ouchi Date: Mon, 30 Jan 2023 22:49:10 +0900 Subject: [PATCH] autofocus the compose form again on /share (#23094) --- app/javascript/mastodon/features/standalone/compose/index.js | 2 +- app/javascript/mastodon/reducers/compose.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/javascript/mastodon/features/standalone/compose/index.js b/app/javascript/mastodon/features/standalone/compose/index.js index 0d764575fd..fbadef6f4e 100644 --- a/app/javascript/mastodon/features/standalone/compose/index.js +++ b/app/javascript/mastodon/features/standalone/compose/index.js @@ -9,7 +9,7 @@ export default class Compose extends React.PureComponent { render () { return (
- + diff --git a/app/javascript/mastodon/reducers/compose.js b/app/javascript/mastodon/reducers/compose.js index 1760c7c891..77faa96a40 100644 --- a/app/javascript/mastodon/reducers/compose.js +++ b/app/javascript/mastodon/reducers/compose.js @@ -222,8 +222,8 @@ const privacyPreference = (a, b) => { 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;