Fix i18n streaming.js

stable/1.0.x
Alex Gleason 2020-06-04 19:43:53 -05:00
rodzic 36f5b6cea8
commit 8b181c38f3
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 4 dodań i 5 usunięć

Wyświetl plik

@ -9,14 +9,13 @@ import {
import { updateNotificationsQueue, expandNotifications } from './notifications'; import { updateNotificationsQueue, expandNotifications } from './notifications';
import { updateConversations } from './conversations'; import { updateConversations } from './conversations';
import { fetchFilters } from './filters'; import { fetchFilters } from './filters';
import { getLocale } from '../locales'; import { getSettings } from 'soapbox/actions/settings';
import messages from 'soapbox/locales/messages';
const { messages } = getLocale();
export function connectTimelineStream(timelineId, path, pollingRefresh = null, accept = null) { export function connectTimelineStream(timelineId, path, pollingRefresh = null, accept = null) {
return connectStream (path, pollingRefresh, (dispatch, getState) => { return connectStream (path, pollingRefresh, (dispatch, getState) => {
const locale = getState().getIn(['meta', 'locale']); const locale = getSettings(getState()).get('locale');
return { return {
onConnect() { onConnect() {
@ -36,7 +35,7 @@ export function connectTimelineStream(timelineId, path, pollingRefresh = null, a
dispatch(deleteFromTimelines(data.payload)); dispatch(deleteFromTimelines(data.payload));
break; break;
case 'notification': case 'notification':
dispatch(updateNotificationsQueue(JSON.parse(data.payload), messages, locale, window.location.pathname)); dispatch(updateNotificationsQueue(JSON.parse(data.payload), messages[locale], locale, window.location.pathname));
break; break;
case 'conversation': case 'conversation':
dispatch(updateConversations(JSON.parse(data.payload))); dispatch(updateConversations(JSON.parse(data.payload)));