[Glitch] Fix /share and cleanup and reorganize frontend locale loading
				
					
				
			Port b0780cfeed to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
			
			
This commit is contained in:
		@@ -1,37 +1,25 @@
 | 
			
		||||
import PropTypes from 'prop-types';
 | 
			
		||||
import { PureComponent } from 'react';
 | 
			
		||||
 | 
			
		||||
import { IntlProvider } from 'react-intl';
 | 
			
		||||
 | 
			
		||||
import { Provider } from 'react-redux';
 | 
			
		||||
 | 
			
		||||
import { fetchCustomEmojis } from 'flavours/glitch/actions/custom_emojis';
 | 
			
		||||
import { hydrateStore } from 'flavours/glitch/actions/store';
 | 
			
		||||
import Compose from 'flavours/glitch/features/standalone/compose';
 | 
			
		||||
import initialState from 'flavours/glitch/initial_state';
 | 
			
		||||
import { IntlProvider } from 'flavours/glitch/locales';
 | 
			
		||||
import { store } from 'flavours/glitch/store';
 | 
			
		||||
 | 
			
		||||
import { getLocale, onProviderError } from 'mastodon/locales';
 | 
			
		||||
 | 
			
		||||
const { messages } = getLocale();
 | 
			
		||||
 | 
			
		||||
if (initialState) {
 | 
			
		||||
  store.dispatch(hydrateStore(initialState));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
store.dispatch(fetchCustomEmojis());
 | 
			
		||||
 | 
			
		||||
export default class TimelineContainer extends PureComponent {
 | 
			
		||||
 | 
			
		||||
  static propTypes = {
 | 
			
		||||
    locale: PropTypes.string.isRequired,
 | 
			
		||||
  };
 | 
			
		||||
export default class ComposeContainer extends PureComponent {
 | 
			
		||||
 | 
			
		||||
  render () {
 | 
			
		||||
    const { locale } = this.props;
 | 
			
		||||
 | 
			
		||||
    return (
 | 
			
		||||
      <IntlProvider locale={locale} messages={messages} onError={onProviderError}>
 | 
			
		||||
      <IntlProvider>
 | 
			
		||||
        <Provider store={store}>
 | 
			
		||||
          <Compose />
 | 
			
		||||
        </Provider>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user