Skip to content

Commit 76a8477

Browse files
authored
Merge pull request #329 from synonymdev/fix/set-default-widgets
fix: Widgets default settings
2 parents d3ce231 + 5642982 commit 76a8477

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

app/src/main/java/to/bitkit/data/SettingsStore.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ data class SettingsData(
8888
val isPinOnIdleEnabled: Boolean = false,
8989
val isPinForPaymentsEnabled: Boolean = false,
9090
val isDevModeEnabled: Boolean = false,
91-
val showWidgets: Boolean = false,
91+
val showWidgets: Boolean = true,
9292
val showWidgetTitles: Boolean = false,
9393
val lastUsedTags: List<String> = emptyList(),
9494
val enableSwipeToHideBalance: Boolean = true,

app/src/main/java/to/bitkit/data/WidgetsStore.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class WidgetsStore @Inject constructor(
5151
it.copy(calculatorValues = calculatorValues)
5252
}
5353
}
54+
5455
suspend fun updateArticles(articles: List<ArticleDTO>) {
5556
store.updateData {
5657
it.copy(articles = articles)
@@ -147,7 +148,11 @@ class WidgetsStore @Inject constructor(
147148

148149
@Serializable
149150
data class WidgetsData(
150-
val widgets: List<WidgetWithPosition> = emptyList(),
151+
val widgets: List<WidgetWithPosition> = listOf(
152+
WidgetWithPosition(type = WidgetType.PRICE, position = 0),
153+
WidgetWithPosition(type = WidgetType.BLOCK, position = 1),
154+
WidgetWithPosition(type = WidgetType.NEWS, position = 2),
155+
),
151156
val headlinePreferences: HeadlinePreferences = HeadlinePreferences(),
152157
val factsPreferences: FactsPreferences = FactsPreferences(),
153158
val blocksPreferences: BlocksPreferences = BlocksPreferences(),

0 commit comments

Comments
 (0)