fix homepage and language defaults

This commit is contained in:
zeppi 2020-11-25 13:04:07 -05:00
parent 2740f908b0
commit 0495dff904
2 changed files with 3 additions and 7 deletions

View file

@ -19,7 +19,7 @@ const select = state => ({
loading: selectFetchingClaimSearch(state), loading: selectFetchingClaimSearch(state),
showNsfw: makeSelectClientSetting(SETTINGS.SHOW_MATURE)(state), showNsfw: makeSelectClientSetting(SETTINGS.SHOW_MATURE)(state),
hideReposts: makeSelectClientSetting(SETTINGS.HIDE_REPOSTS)(state), hideReposts: makeSelectClientSetting(SETTINGS.HIDE_REPOSTS)(state),
language: selectLanguage(state), languageSetting: selectLanguage(state),
hiddenUris: selectBlockedChannels(state), hiddenUris: selectBlockedChannels(state),
searchInLanguage: makeSelectClientSetting(SETTINGS.SEARCH_IN_LANGUAGE)(state), searchInLanguage: makeSelectClientSetting(SETTINGS.SEARCH_IN_LANGUAGE)(state),
}); });

View file

@ -55,7 +55,7 @@ export const selectThemePath = createSelector(
); );
export const selectHomepageCode = createSelector(makeSelectClientSetting(SETTINGS.HOMEPAGE), setting => { export const selectHomepageCode = createSelector(makeSelectClientSetting(SETTINGS.HOMEPAGE), setting => {
return setting || getDefaultHomepage(); return homepages[setting] ? setting : getDefaultHomepage();
}); });
export const selectLanguage = createSelector(makeSelectClientSetting(SETTINGS.LANGUAGE), setting => { export const selectLanguage = createSelector(makeSelectClientSetting(SETTINGS.LANGUAGE), setting => {
@ -67,12 +67,8 @@ export const selectHomepageData = createSelector(
selectHomepageCode, selectHomepageCode,
homepageCode => { homepageCode => {
// homepages = { 'en': homepageFile, ... } // homepages = { 'en': homepageFile, ... }
if (!homepageCode || !homepages[homepageCode]) {
return getDefaultHomepage();
} else {
return homepages[homepageCode]; return homepages[homepageCode];
} }
}
); );
export const selectosNotificationsEnabled = makeSelectClientSetting(SETTINGS.OS_NOTIFICATIONS_ENABLED); export const selectosNotificationsEnabled = makeSelectClientSetting(SETTINGS.OS_NOTIFICATIONS_ENABLED);