Import lang/theme

This commit is contained in:
shilangyu 2021-04-23 19:26:30 +02:00
parent 847eb3414f
commit f524dc3884
1 changed files with 13 additions and 15 deletions

View File

@ -86,23 +86,21 @@ class ConfigStore extends ChangeNotifier {
/// Copies over settings from lemmy to [ConfigStore]
void copyLemmyUserSettings(LocalUserSettings localUserSettings) {
// themes from lemmy-ui that are dark mode
// const darkModeLemmyUiThemes = {
// 'solar',
// 'cyborg',
// 'darkly',
// 'vaporwave-dark',
// // TODO: is it dark theme?
// 'i386',
// };
const darkModeLemmyUiThemes = {
'solar',
'cyborg',
'darkly',
'vaporwave-dark',
'i386',
};
_showAvatars = localUserSettings.showAvatars;
// TODO: should these also be imported? If so, how?
// _theme = darkModeLemmyUiThemes.contains(localUserSettings.theme)
// ? ThemeMode.dark
// : ThemeMode.light;
// _locale = L10n.supportedLocales.contains(Locale(localUserSettings.lang))
// ? Locale(localUserSettings.lang)
// : _locale;
_theme = darkModeLemmyUiThemes.contains(localUserSettings.theme)
? ThemeMode.dark
: ThemeMode.light;
_locale = L10n.supportedLocales.contains(Locale(localUserSettings.lang))
? Locale(localUserSettings.lang)
: _locale;
// TODO: add when it is released
// _showScores = localUserSettings.showScores;
_defaultSortType = localUserSettings.defaultSortType;