mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-05-11 15:24:58 +00:00
core: api to differentiate contacts and conversations (#4111)
This commit is contained in:
@@ -50,7 +50,8 @@ data AppSettings = AppSettings
|
||||
uiColorScheme :: Maybe UIColorScheme,
|
||||
uiDarkColorScheme :: Maybe DarkColorScheme,
|
||||
uiCurrentThemeIds :: Maybe (Map ThemeColorScheme Text),
|
||||
uiThemes :: Maybe [UITheme]
|
||||
uiThemes :: Maybe [UITheme],
|
||||
oneHandUI :: Maybe Bool
|
||||
}
|
||||
deriving (Show)
|
||||
|
||||
@@ -81,7 +82,8 @@ defaultAppSettings =
|
||||
uiColorScheme = Just UCSSystem,
|
||||
uiDarkColorScheme = Just DCSSimplex,
|
||||
uiCurrentThemeIds = Nothing,
|
||||
uiThemes = Nothing
|
||||
uiThemes = Nothing,
|
||||
oneHandUI = Just True
|
||||
}
|
||||
|
||||
defaultParseAppSettings :: AppSettings
|
||||
@@ -111,7 +113,8 @@ defaultParseAppSettings =
|
||||
uiColorScheme = Nothing,
|
||||
uiDarkColorScheme = Nothing,
|
||||
uiCurrentThemeIds = Nothing,
|
||||
uiThemes = Nothing
|
||||
uiThemes = Nothing,
|
||||
oneHandUI = Nothing
|
||||
}
|
||||
|
||||
combineAppSettings :: AppSettings -> AppSettings -> AppSettings
|
||||
@@ -141,7 +144,8 @@ combineAppSettings platformDefaults storedSettings =
|
||||
uiColorScheme = p uiColorScheme,
|
||||
uiDarkColorScheme = p uiDarkColorScheme,
|
||||
uiCurrentThemeIds = p uiCurrentThemeIds,
|
||||
uiThemes = p uiThemes
|
||||
uiThemes = p uiThemes,
|
||||
oneHandUI = p oneHandUI
|
||||
}
|
||||
where
|
||||
p :: (AppSettings -> Maybe a) -> Maybe a
|
||||
@@ -184,6 +188,7 @@ instance FromJSON AppSettings where
|
||||
uiDarkColorScheme <- p "uiDarkColorScheme"
|
||||
uiCurrentThemeIds <- p "uiCurrentThemeIds"
|
||||
uiThemes <- p "uiThemes"
|
||||
oneHandUI <- p "oneHandUI"
|
||||
pure
|
||||
AppSettings
|
||||
{ appPlatform,
|
||||
@@ -210,7 +215,8 @@ instance FromJSON AppSettings where
|
||||
uiColorScheme,
|
||||
uiDarkColorScheme,
|
||||
uiCurrentThemeIds,
|
||||
uiThemes
|
||||
uiThemes,
|
||||
oneHandUI
|
||||
}
|
||||
where
|
||||
p key = v .:? key <|> pure Nothing
|
||||
|
||||
Reference in New Issue
Block a user