Skip to content

Commit a073005

Browse files
authored
Merge pull request #1108 from sssurvey/update-tutorial-5-to-correct-minor-errors
Correcting sample code snippet in Tutorial 5
2 parents 825d072 + 3469ab4 commit a073005

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

samples/tutorial/Tutorial5.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,11 @@ object WelcomeWorkflow : StatefulWorkflow<Unit, State, LoggedIn, WelcomeScreen>(
7171
// ...
7272

7373
internal fun onNameChanged(name: String) = action {
74-
state = state.copy(name = name)
74+
state = state.copy(username = name)
7575
}
7676

7777
internal fun onLogin() = action {
78-
if (state.name.isNotEmpty()) {
79-
setOutput(LoggedIn(state.name))
80-
}
78+
setOutput(LoggedIn(state.username))
8179
}
8280
}
8381
```

0 commit comments

Comments
 (0)