This commit is contained in:
2026-07-18 14:19:35 +07:00
parent c69cd6cf7a
commit cb70e49264
3 changed files with 12 additions and 26 deletions

View File

@@ -19,25 +19,18 @@ relay_auth = { path = "../crates/relay_auth" }
gpui.workspace = true gpui.workspace = true
gpui_platform.workspace = true gpui_platform.workspace = true
gpui_tokio.workspace = true
gpui_web = { git = "https://github.com/zed-industries/zed" } gpui_web = { git = "https://github.com/zed-industries/zed" }
nostr-connect.workspace = true
nostr-sdk.workspace = true nostr-sdk.workspace = true
anyhow.workspace = true
serde.workspace = true
serde_json.workspace = true
itertools.workspace = true
log.workspace = true log.workspace = true
smallvec.workspace = true
smol.workspace = true
futures.workspace = true
oneshot.workspace = true
webbrowser.workspace = true
tracing-subscriber.workspace = true
console_error_panic_hook = "0.1" console_error_panic_hook = "0.1"
tracing-wasm = "0.2" tracing-wasm = "0.2"
console_log = "1.0" console_log = "1.0"
wasm-bindgen = "0.2" wasm-bindgen = "0.2"
[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom_0_2 = { package = "getrandom", version = "0.2", features = ["js"] }
getrandom_0_3 = { package = "getrandom", version = "0.3", features = ["wasm_js"] }
getrandom_0_4 = { package = "getrandom", version = "0.4", features = ["wasm_js"] }
tokio = { version = "1", default-features = false, features = ["sync", "macros", "io-util", "rt", "time"] }

4
web/rust-toolchain.toml Normal file
View File

@@ -0,0 +1,4 @@
[toolchain]
channel = "nightly"
components = ["rustfmt", "clippy"]
targets = ["wasm32-unknown-unknown"]

View File

@@ -15,21 +15,9 @@ pub fn run() -> Result<(), JsValue> {
#[cfg(target_family = "wasm")] #[cfg(target_family = "wasm")]
gpui_platform::web_init(); gpui_platform::web_init();
#[cfg(not(target_family = "wasm"))] gpui_platform::application().run(|cx| {
let app = gpui_platform::application();
#[cfg(target_family = "wasm")]
let app = gpui_platform::single_threaded_web();
app.run(|cx| {
cx.open_window(WindowOptions::default(), |window, cx| { cx.open_window(WindowOptions::default(), |window, cx| {
// Bring the app to the foreground
cx.activate(true);
cx.new(|cx| { cx.new(|cx| {
// Initialize the tokio runtime
gpui_tokio::init(cx);
// Initialize components // Initialize components
ui::init(cx); ui::init(cx);
@@ -61,6 +49,7 @@ pub fn run() -> Result<(), JsValue> {
}) })
}) })
.expect("Failed to open window. Please restart the application."); .expect("Failed to open window. Please restart the application.");
cx.activate(true);
}); });
Ok(()) Ok(())