Commit a02d615
#291 Fix favorite FAB not updating in market detail screen
Three fixes combined:
- ViewModel: toggleFavoriteState() was setting isFavorite = isFavorite
instead of !isFavorite, so StateFlow never emitted a changed value
- Screen: move onFavoriteClick to FloatingActionButton's onClick so the
FAB owns the tap event
- FavoriteIcon: make onFavoriteClick nullable and skip adding .clickable
when null, so the icon no longer silently consumes taps that should
reach the parent FAB
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent f312746 commit a02d615
File tree
3 files changed
+7
-12
lines changed- feature/marketdetail/src/main/java/ir/composenews/marketdetail
- library/designsystem/src/main/java/ir/composenews/designsystem/component
3 files changed
+7
-12
lines changedLines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
117 | 117 | | |
118 | | - | |
119 | | - | |
120 | | - | |
| 118 | + | |
121 | 119 | | |
122 | 120 | | |
123 | 121 | | |
| |||
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
127 | | - | |
| 126 | + | |
128 | 127 | | |
129 | 128 | | |
130 | 129 | | |
Lines changed: 4 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
75 | | - | |
76 | | - | |
| 74 | + | |
77 | 75 | | |
78 | 76 | | |
79 | 77 | | |
| |||
84 | 82 | | |
85 | 83 | | |
86 | 84 | | |
87 | | - | |
88 | | - | |
| 85 | + | |
| 86 | + | |
89 | 87 | | |
90 | 88 | | |
91 | 89 | | |
| |||
0 commit comments