fixed lots of bugs by return Action enums in song_editor and library
Instead of dealing with a complication of every return from a component being a Task<Message>, I create an Action enum that only contains Tasks when needed and other specific actions that the overarching App should handle to interact with other parts of it.
This commit is contained in:
parent
e5981d006b
commit
66e33be26c
8 changed files with 272 additions and 220 deletions
|
@ -1,3 +1,5 @@
|
|||
use crate::core::model::LibraryKind;
|
||||
|
||||
pub mod double_ended_slider;
|
||||
pub mod library;
|
||||
pub mod presenter;
|
||||
|
@ -11,3 +13,14 @@ pub enum EditorMode {
|
|||
Presentation,
|
||||
Slide,
|
||||
}
|
||||
|
||||
impl From<LibraryKind> for EditorMode {
|
||||
fn from(value: LibraryKind) -> Self {
|
||||
match value {
|
||||
LibraryKind::Song => Self::Song,
|
||||
LibraryKind::Video => Self::Video,
|
||||
LibraryKind::Image => Self::Image,
|
||||
LibraryKind::Presentation => Self::Presentation,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue