Let the user choose theme (#1499)
This commit is contained in:
parent
a8fbb882f2
commit
68f9c81628
13 changed files with 216 additions and 3 deletions
|
|
@ -24,10 +24,12 @@ class InMemoryPreferencesStore(
|
|||
isRichTextEditorEnabled: Boolean = false,
|
||||
isDeveloperModeEnabled: Boolean = false,
|
||||
customElementCallBaseUrl: String? = null,
|
||||
theme: String? = null,
|
||||
) : PreferencesStore {
|
||||
private var _isRichTextEditorEnabled = MutableStateFlow(isRichTextEditorEnabled)
|
||||
private var _isDeveloperModeEnabled = MutableStateFlow(isDeveloperModeEnabled)
|
||||
private var _customElementCallBaseUrl = MutableStateFlow(customElementCallBaseUrl)
|
||||
private var _theme = MutableStateFlow(theme)
|
||||
|
||||
override suspend fun setRichTextEditorEnabled(enabled: Boolean) {
|
||||
_isRichTextEditorEnabled.value = enabled
|
||||
|
|
@ -53,6 +55,14 @@ class InMemoryPreferencesStore(
|
|||
return _customElementCallBaseUrl
|
||||
}
|
||||
|
||||
override suspend fun setTheme(theme: String) {
|
||||
_theme.value = theme
|
||||
}
|
||||
|
||||
override fun getThemeFlow(): Flow<String?> {
|
||||
return _theme
|
||||
}
|
||||
|
||||
override suspend fun reset() {
|
||||
// No op
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue