Fix doc when state is missing (#13049)

# Objective

The warning mentions the function `add_state` which doesn't exist;
replaced with `init_state`
This commit is contained in:
Charles Bournhonesque 2024-04-21 09:19:26 -04:00 committed by GitHub
parent 54456b7ea6
commit 13cac2eeff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -752,7 +752,7 @@ pub mod common_conditions {
move |current_state: Option<Res<State<S>>>| match current_state { move |current_state: Option<Res<State<S>>>| match current_state {
Some(current_state) => *current_state == state, Some(current_state) => *current_state == state,
None => { None => {
warn_once!("No state matching the type for {} exists - did you forget to `add_state` when initializing the app?", { warn_once!("No state matching the type for {} exists - did you forget to `init_state` when initializing the app?", {
let debug_state = format!("{state:?}"); let debug_state = format!("{state:?}");
let result = debug_state let result = debug_state
.split("::") .split("::")