diff options
Diffstat (limited to 'examples/todos/src')
-rw-r--r-- | examples/todos/src/main.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/examples/todos/src/main.rs b/examples/todos/src/main.rs index bfae5e88..8262b537 100644 --- a/examples/todos/src/main.rs +++ b/examples/todos/src/main.rs @@ -38,7 +38,12 @@ enum Message { } impl Application for Todos { + #[cfg(not(target_arch = "wasm32"))] type Executor = iced_futures::executor::AsyncStd; + + #[cfg(target_arch = "wasm32")] + type Executor = iced_futures::executor::WasmBindgen; + type Message = Message; fn new() -> (Todos, Command<Message>) { @@ -377,6 +382,7 @@ impl Controls { ) .push( Row::new() + .width(Length::Shrink) .spacing(10) .push(filter_button( all_button, @@ -493,6 +499,7 @@ enum SaveError { FormatError, } +#[cfg(not(target_arch = "wasm32"))] impl SavedState { fn path() -> std::path::PathBuf { let mut path = if let Some(project_dirs) = @@ -555,6 +562,18 @@ impl SavedState { } } +// TODO +#[cfg(target_arch = "wasm32")] +impl SavedState { + async fn load() -> Result<SavedState, LoadError> { + Err(LoadError::FileError) + } + + async fn save(self) -> Result<(), SaveError> { + Err(SaveError::FileError) + } +} + mod style { use iced::{button, Background, Color, Vector}; |