Put model state into an Arc (#28)
Build Mumble Web 2 / macos_build (push) Successful in 1m14s
Build Mumble Web 2 / linux_build (push) Successful in 1m27s
Build Mumble Web 2 / windows_build (push) Successful in 2m56s
Build Mumble Web 2 / android_build (push) Successful in 4m39s

Previously the model state was in a `static STATE` to make it accessible to all the various subsystems. This moves it into an Arc and plumbs the reference around via function arguments. That allows us to do non-static initialization, eg based on user config. I also moved some things into dioxus context.

Co-authored-by: Sam Sartor <me@samsartor.com>
Co-committed-by: Sam Sartor <me@samsartor.com>
This commit was merged in pull request #28.
This commit is contained in:
2026-03-30 00:56:36 +00:00
committed by Sam Sartor
parent 7337b3e49b
commit f0ce15000e
9 changed files with 115 additions and 70 deletions
+3 -1
View File
@@ -1,6 +1,6 @@
/// Stub implementation of the platform interface, so that we can
/// `cargo check` without any --feature flags.
use crate::effects::AudioProcessor;
use crate::{app::SharedState, effects::AudioProcessor};
use color_eyre::eyre::Error;
use dioxus::hooks::UnboundedReceiver;
use mumble_web2_common::{ProxyOverrides, ServerStatus};
@@ -25,6 +25,7 @@ impl super::PlatformInterface for StubPlatform {
_username: String,
_event_rx: &mut UnboundedReceiver<crate::app::Command>,
_overrides: &ProxyOverrides,
_state: SharedState,
) -> impl Future<Output = Result<(), Error>> {
async { panic!("stubbed platform") }
}
@@ -77,6 +78,7 @@ impl super::AudioPlayerInterface for StubAudioPlayer {
}
}
#[derive(Clone)]
pub struct StubConfigSystem;
impl super::ConfigSystemInterface for StubConfigSystem {