Commit 8a0881e
fix(android): move validateAndGetIterations before launchers, fix stale state capture
Two issues fixed:
1. validateAndGetIterations() was defined AFTER the CreateDocument launchers
that reference it — Kotlin/K2 compiler may reject forward references to
local functions from within Composable lambda captures. Move the function
(and isZh) before the launcher declarations.
2. Launcher callbacks captured password/algorithm from outer val
(snapshot at composition time = empty string). Use
homeViewModel.password.value / .algorithm.value to read the latest
values when the callback actually fires.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 5def9e5 commit 8a0881e
1 file changed
Lines changed: 31 additions & 19 deletions
Lines changed: 31 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
64 | 81 | | |
65 | 82 | | |
66 | 83 | | |
67 | 84 | | |
68 | 85 | | |
69 | 86 | | |
70 | 87 | | |
71 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
72 | 95 | | |
73 | 96 | | |
74 | 97 | | |
| |||
85 | 108 | | |
86 | 109 | | |
87 | 110 | | |
88 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
89 | 118 | | |
90 | 119 | | |
91 | 120 | | |
| |||
96 | 125 | | |
97 | 126 | | |
98 | 127 | | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | 128 | | |
117 | 129 | | |
118 | 130 | | |
| |||
0 commit comments