Commit 0d9484c
committed
Reset back-press callback on Loading and Empty in ChatHistoryFragment
The callback's isEnabled flag was only assigned inside the Loaded branch of
render(); a transition out of Loaded (e.g. last chat deleted externally while
in select mode) left it enabled but with no matching case in handleOnBackPressed,
silently consuming every back press and the toolbar nav arrow.
Re-derive isEnabled from the rendered state at the end of render() via a pure
helper, so every transition recomputes it and any future state defaults to off.1 parent e9d8f7c commit 0d9484c
1 file changed
Lines changed: 9 additions & 2 deletions
File tree
- duckchat/duckchat-impl/src/main/java/com/duckduckgo/duckchat/impl/history
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
147 | 146 | | |
148 | 147 | | |
149 | 148 | | |
150 | 149 | | |
151 | | - | |
152 | 150 | | |
153 | 151 | | |
154 | 152 | | |
155 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
156 | 163 | | |
157 | 164 | | |
158 | 165 | | |
| |||
0 commit comments