* Update dependencies including Fastlane and disable Flipper on iOS * Remove EventEmitter for previous doc-viewer * Fix android crash when setting more channels buttons * Downgrade fuse.js * Upgrade deps to latest * Update Podfile.lock * Downgrade RNN to 6.4.0 * QA Review #2 * Upgrade fuse.js to 6.0.0
26 lines
622 B
JavaScript
26 lines
622 B
JavaScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import {combineReducers} from 'redux';
|
|
import {getLocales} from 'react-native-localize';
|
|
|
|
import {UserTypes} from '@mm-redux/action_types';
|
|
|
|
const defaultLocale = getLocales()[0].languageCode;
|
|
|
|
function locale(state = defaultLocale, action) {
|
|
switch (action.type) {
|
|
case UserTypes.RECEIVED_ME: {
|
|
const data = action.data || action.payload;
|
|
if (data?.locale) {
|
|
return data.locale;
|
|
}
|
|
}
|
|
}
|
|
|
|
return state;
|
|
}
|
|
|
|
export default combineReducers({
|
|
locale,
|
|
});
|