Commit e56036d
committed
refactor: manage cache size observation lifecycle in ProfileViewModel
- Introduce `cacheSizeJob` to track the coroutine responsible for observing cache size changes.
- Update `refreshCacheSize` to prevent spawning redundant observation jobs if one is already active.
- Ensure the existing `cacheSizeJob` is cancelled and reset when clearing the cache to trigger a fresh update cycle.1 parent d901a6c commit e56036d
1 file changed
Lines changed: 10 additions & 5 deletions
File tree
- feature/profile/presentation/src/commonMain/kotlin/zed/rainxch/profile/presentation
Lines changed: 10 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
79 | 83 | | |
80 | 84 | | |
81 | | - | |
82 | 85 | | |
83 | 86 | | |
84 | 87 | | |
| |||
312 | 315 | | |
313 | 316 | | |
314 | 317 | | |
| 318 | + | |
| 319 | + | |
315 | 320 | | |
316 | 321 | | |
317 | 322 | | |
| |||
0 commit comments