Compare commits
4
Commits
f7f1ea7438
...
web-build
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a6e50cf3aa | ||
|
|
8f272f1fe8 | ||
|
|
6a7bf17e6e | ||
|
|
3290f71fa4 |
Generated
+35
-34
@@ -1251,7 +1251,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "collections"
|
name = "collections"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/zed-industries/zed#bce0c5785bfd9172c939aca4083fd70bc4930927"
|
source = "git+https://github.com/zed-industries/zed#ce48461eaadd16c65c31f835511ab96bd3b6e746"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"gpui_util",
|
"gpui_util",
|
||||||
"indexmap",
|
"indexmap",
|
||||||
@@ -1768,7 +1768,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "derive_refineable"
|
name = "derive_refineable"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/zed-industries/zed#bce0c5785bfd9172c939aca4083fd70bc4930927"
|
source = "git+https://github.com/zed-industries/zed#ce48461eaadd16c65c31f835511ab96bd3b6e746"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@@ -2665,7 +2665,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "gpui"
|
name = "gpui"
|
||||||
version = "0.2.2"
|
version = "0.2.2"
|
||||||
source = "git+https://github.com/zed-industries/zed#bce0c5785bfd9172c939aca4083fd70bc4930927"
|
source = "git+https://github.com/zed-industries/zed#ce48461eaadd16c65c31f835511ab96bd3b6e746"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"accesskit",
|
"accesskit",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
@@ -2750,7 +2750,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "gpui_apple"
|
name = "gpui_apple"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/zed-industries/zed#bce0c5785bfd9172c939aca4083fd70bc4930927"
|
source = "git+https://github.com/zed-industries/zed#ce48461eaadd16c65c31f835511ab96bd3b6e746"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"block",
|
"block",
|
||||||
@@ -2773,7 +2773,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "gpui_linux"
|
name = "gpui_linux"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/zed-industries/zed#bce0c5785bfd9172c939aca4083fd70bc4930927"
|
source = "git+https://github.com/zed-industries/zed#ce48461eaadd16c65c31f835511ab96bd3b6e746"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"accesskit",
|
"accesskit",
|
||||||
"accesskit_unix",
|
"accesskit_unix",
|
||||||
@@ -2819,7 +2819,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "gpui_macos"
|
name = "gpui_macos"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/zed-industries/zed#bce0c5785bfd9172c939aca4083fd70bc4930927"
|
source = "git+https://github.com/zed-industries/zed#ce48461eaadd16c65c31f835511ab96bd3b6e746"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"accesskit",
|
"accesskit",
|
||||||
"accesskit_macos",
|
"accesskit_macos",
|
||||||
@@ -2865,7 +2865,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "gpui_macros"
|
name = "gpui_macros"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/zed-industries/zed#bce0c5785bfd9172c939aca4083fd70bc4930927"
|
source = "git+https://github.com/zed-industries/zed#ce48461eaadd16c65c31f835511ab96bd3b6e746"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"heck 0.5.0",
|
"heck 0.5.0",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
@@ -2876,7 +2876,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "gpui_platform"
|
name = "gpui_platform"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/zed-industries/zed#bce0c5785bfd9172c939aca4083fd70bc4930927"
|
source = "git+https://github.com/zed-industries/zed#ce48461eaadd16c65c31f835511ab96bd3b6e746"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"console_error_panic_hook",
|
"console_error_panic_hook",
|
||||||
"gpui",
|
"gpui",
|
||||||
@@ -2889,7 +2889,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "gpui_shared_string"
|
name = "gpui_shared_string"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/zed-industries/zed#bce0c5785bfd9172c939aca4083fd70bc4930927"
|
source = "git+https://github.com/zed-industries/zed#ce48461eaadd16c65c31f835511ab96bd3b6e746"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"schemars",
|
"schemars",
|
||||||
"serde",
|
"serde",
|
||||||
@@ -2899,7 +2899,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "gpui_tokio"
|
name = "gpui_tokio"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/zed-industries/zed#bce0c5785bfd9172c939aca4083fd70bc4930927"
|
source = "git+https://github.com/zed-industries/zed#ce48461eaadd16c65c31f835511ab96bd3b6e746"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"gpui",
|
"gpui",
|
||||||
@@ -2910,7 +2910,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "gpui_util"
|
name = "gpui_util"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/zed-industries/zed#bce0c5785bfd9172c939aca4083fd70bc4930927"
|
source = "git+https://github.com/zed-industries/zed#ce48461eaadd16c65c31f835511ab96bd3b6e746"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"log",
|
"log",
|
||||||
@@ -2920,7 +2920,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "gpui_web"
|
name = "gpui_web"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/zed-industries/zed#bce0c5785bfd9172c939aca4083fd70bc4930927"
|
source = "git+https://github.com/zed-industries/zed#ce48461eaadd16c65c31f835511ab96bd3b6e746"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"console_error_panic_hook",
|
"console_error_panic_hook",
|
||||||
@@ -2944,7 +2944,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "gpui_wgpu"
|
name = "gpui_wgpu"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/zed-industries/zed#bce0c5785bfd9172c939aca4083fd70bc4930927"
|
source = "git+https://github.com/zed-industries/zed#ce48461eaadd16c65c31f835511ab96bd3b6e746"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
@@ -2970,7 +2970,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "gpui_windows"
|
name = "gpui_windows"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/zed-industries/zed#bce0c5785bfd9172c939aca4083fd70bc4930927"
|
source = "git+https://github.com/zed-industries/zed#ce48461eaadd16c65c31f835511ab96bd3b6e746"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"accesskit",
|
"accesskit",
|
||||||
"accesskit_windows",
|
"accesskit_windows",
|
||||||
@@ -3148,9 +3148,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hermit-abi"
|
name = "hermit-abi"
|
||||||
version = "0.5.2"
|
version = "0.5.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c"
|
checksum = "e17592d60ebacc7d5e169f4663c5f84f9161cc90328abcfe8456f41e4dfcb284"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hex"
|
name = "hex"
|
||||||
@@ -3245,7 +3245,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "http_client"
|
name = "http_client"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/zed-industries/zed#bce0c5785bfd9172c939aca4083fd70bc4930927"
|
source = "git+https://github.com/zed-industries/zed#ce48461eaadd16c65c31f835511ab96bd3b6e746"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"async-compression",
|
"async-compression",
|
||||||
@@ -3265,7 +3265,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "http_client_tls"
|
name = "http_client_tls"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/zed-industries/zed#bce0c5785bfd9172c939aca4083fd70bc4930927"
|
source = "git+https://github.com/zed-industries/zed#ce48461eaadd16c65c31f835511ab96bd3b6e746"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"log",
|
"log",
|
||||||
"rustls",
|
"rustls",
|
||||||
@@ -3949,9 +3949,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lyon_algorithms"
|
name = "lyon_algorithms"
|
||||||
version = "1.0.20"
|
version = "1.0.21"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8575c0d003ae459399623c4def180c63b77f343b1a7fee64f249b349e7699a31"
|
checksum = "cdfa8785f95e57914ddb35e3b59994aeba6f5e79e9cfd03da1c269f010f36009"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"lyon_path",
|
"lyon_path",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
@@ -3980,9 +3980,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lyon_tessellation"
|
name = "lyon_tessellation"
|
||||||
version = "1.0.20"
|
version = "1.0.21"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8e43b7e44161571868f5c931d12583592c223c5583eef86b08aa02b7048a3552"
|
checksum = "dabea159dc6eea9171a541b458134b70ca95e3162d068132b2b3b9bc01aad06e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"float_next_after",
|
"float_next_after",
|
||||||
"lyon_path",
|
"lyon_path",
|
||||||
@@ -4044,7 +4044,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "media"
|
name = "media"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/zed-industries/zed#bce0c5785bfd9172c939aca4083fd70bc4930927"
|
source = "git+https://github.com/zed-industries/zed#ce48461eaadd16c65c31f835511ab96bd3b6e746"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"bindgen",
|
"bindgen",
|
||||||
@@ -4600,6 +4600,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "d49e936b501e5c5bf01fda3a9452ff86dc3ea98ad5f283e1455153142d97518c"
|
checksum = "d49e936b501e5c5bf01fda3a9452ff86dc3ea98ad5f283e1455153142d97518c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.13.1",
|
"bitflags 2.13.1",
|
||||||
|
"block2 0.6.2",
|
||||||
"objc2 0.6.4",
|
"objc2 0.6.4",
|
||||||
"objc2-core-foundation",
|
"objc2-core-foundation",
|
||||||
"objc2-foundation 0.3.2",
|
"objc2-foundation 0.3.2",
|
||||||
@@ -4970,7 +4971,7 @@ checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "perf"
|
name = "perf"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/zed-industries/zed#bce0c5785bfd9172c939aca4083fd70bc4930927"
|
source = "git+https://github.com/zed-industries/zed#ce48461eaadd16c65c31f835511ab96bd3b6e746"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"collections",
|
"collections",
|
||||||
"serde",
|
"serde",
|
||||||
@@ -5742,7 +5743,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "refineable"
|
name = "refineable"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/zed-industries/zed#bce0c5785bfd9172c939aca4083fd70bc4930927"
|
source = "git+https://github.com/zed-industries/zed#ce48461eaadd16c65c31f835511ab96bd3b6e746"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"derive_refineable",
|
"derive_refineable",
|
||||||
]
|
]
|
||||||
@@ -5824,7 +5825,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "reqwest_client"
|
name = "reqwest_client"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/zed-industries/zed#bce0c5785bfd9172c939aca4083fd70bc4930927"
|
source = "git+https://github.com/zed-industries/zed#ce48461eaadd16c65c31f835511ab96bd3b6e746"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"bytes",
|
"bytes",
|
||||||
@@ -6125,7 +6126,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "scheduler"
|
name = "scheduler"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/zed-industries/zed#bce0c5785bfd9172c939aca4083fd70bc4930927"
|
source = "git+https://github.com/zed-industries/zed#ce48461eaadd16c65c31f835511ab96bd3b6e746"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-task",
|
"async-task",
|
||||||
"backtrace",
|
"backtrace",
|
||||||
@@ -6719,7 +6720,7 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "sum_tree"
|
name = "sum_tree"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/zed-industries/zed#bce0c5785bfd9172c939aca4083fd70bc4930927"
|
source = "git+https://github.com/zed-industries/zed#ce48461eaadd16c65c31f835511ab96bd3b6e746"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"heapless 0.9.3",
|
"heapless 0.9.3",
|
||||||
"log",
|
"log",
|
||||||
@@ -7758,7 +7759,7 @@ checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be"
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "util_macros"
|
name = "util_macros"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/zed-industries/zed#bce0c5785bfd9172c939aca4083fd70bc4930927"
|
source = "git+https://github.com/zed-industries/zed#ce48461eaadd16c65c31f835511ab96bd3b6e746"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"perf",
|
"perf",
|
||||||
"quote",
|
"quote",
|
||||||
@@ -7797,9 +7798,9 @@ checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "value-bag"
|
name = "value-bag"
|
||||||
version = "1.14.0"
|
version = "1.13.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "11d4788a546b899f8656382fe210e0c478fe3d2dcd6263d50cb6cc268240de6c"
|
checksum = "068e763e8279de7ab94b6afebded2cb701678af094feb1c12ccb061b4783c1be"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"value-bag-serde1",
|
"value-bag-serde1",
|
||||||
"value-bag-sval2",
|
"value-bag-sval2",
|
||||||
@@ -9433,7 +9434,7 @@ checksum = "34b31d188d9d685a4f9c7b46d6e36631b07058d2cfe190267adce54dc230bf12"
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "zlog"
|
name = "zlog"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/zed-industries/zed#bce0c5785bfd9172c939aca4083fd70bc4930927"
|
source = "git+https://github.com/zed-industries/zed#ce48461eaadd16c65c31f835511ab96bd3b6e746"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"chrono",
|
"chrono",
|
||||||
@@ -9450,7 +9451,7 @@ checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ztracing"
|
name = "ztracing"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/zed-industries/zed#bce0c5785bfd9172c939aca4083fd70bc4930927"
|
source = "git+https://github.com/zed-industries/zed#ce48461eaadd16c65c31f835511ab96bd3b6e746"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"tracing",
|
"tracing",
|
||||||
"tracing-subscriber",
|
"tracing-subscriber",
|
||||||
@@ -9461,7 +9462,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "ztracing_macro"
|
name = "ztracing_macro"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/zed-industries/zed#bce0c5785bfd9172c939aca4083fd70bc4930927"
|
source = "git+https://github.com/zed-industries/zed#ce48461eaadd16c65c31f835511ab96bd3b6e746"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zune-core"
|
name = "zune-core"
|
||||||
|
|||||||
+15
-10
@@ -233,7 +233,7 @@ impl ChatRegistry {
|
|||||||
if event.kind == Kind::InboxRelays {
|
if event.kind == Kind::InboxRelays {
|
||||||
let current_user = signer.get_public_key_async().await?;
|
let current_user = signer.get_public_key_async().await?;
|
||||||
if event.pubkey == current_user {
|
if event.pubkey == current_user {
|
||||||
tx.send_async(Signal::InboxReady).await?;
|
tx.send_async(Signal::InboxReady).await.ok();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -262,24 +262,24 @@ impl ChatRegistry {
|
|||||||
|
|
||||||
if rumor.tags.is_empty() {
|
if rumor.tags.is_empty() {
|
||||||
let signal = Signal::error(&event, "Recipient is missing");
|
let signal = Signal::error(&event, "Recipient is missing");
|
||||||
tx.send_async(signal).await?;
|
tx.send_async(signal).await.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Emit message for both new and backlog events
|
// Emit message for both new and backlog events
|
||||||
let signal = Signal::message(event.id, rumor);
|
let signal = Signal::message(event.id, rumor);
|
||||||
tx.send_async(signal).await?;
|
tx.send_async(signal).await.ok();
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
let reason = format!("Failed to extract rumor: {e}");
|
let reason = format!("Failed to extract rumor: {e}");
|
||||||
let signal = Signal::error(event.as_ref(), reason);
|
let signal = Signal::error(event.as_ref(), reason);
|
||||||
tx.send_async(signal).await?;
|
tx.send_async(signal).await.ok();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RelayMessage::EndOfStoredEvents(id)
|
RelayMessage::EndOfStoredEvents(id)
|
||||||
if (id.as_ref() == &sub_id1 || id.as_ref() == &sub_id2) =>
|
if (id.as_ref() == &sub_id1 || id.as_ref() == &sub_id2) =>
|
||||||
{
|
{
|
||||||
tx.send_async(Signal::Eose).await?;
|
tx.send_async(Signal::Eose).await.ok();
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
@@ -290,7 +290,11 @@ impl ChatRegistry {
|
|||||||
|
|
||||||
self.signal_consumer = Some(cx.spawn(async move |this, cx| {
|
self.signal_consumer = Some(cx.spawn(async move |this, cx| {
|
||||||
while let Ok(message) = rx.recv_async().await {
|
while let Ok(message) = rx.recv_async().await {
|
||||||
this.update(cx, |this, cx| {
|
// `update_in` (rather than `update`) routes through a
|
||||||
|
// try-borrow: on wasm a task poll that lands while the app
|
||||||
|
// context is borrowed can't panic and kill this consumer
|
||||||
|
// (which would stall all message delivery).
|
||||||
|
this.update_in(cx, |this, _window, cx| {
|
||||||
// Drain the whole queue in a single update so a burst of
|
// Drain the whole queue in a single update so a burst of
|
||||||
// events (e.g. history sync after login) collapses into
|
// events (e.g. history sync after login) collapses into
|
||||||
// one repaint instead of one per message (important on
|
// one repaint instead of one per message (important on
|
||||||
@@ -374,7 +378,7 @@ impl ChatRegistry {
|
|||||||
.is_some();
|
.is_some();
|
||||||
|
|
||||||
if !found {
|
if !found {
|
||||||
this.update(cx, |_this, cx| {
|
this.update_in(cx, |_this, _window, cx| {
|
||||||
cx.emit(ChatEvent::InboxRelayNotFound);
|
cx.emit(ChatEvent::InboxRelayNotFound);
|
||||||
})?;
|
})?;
|
||||||
}
|
}
|
||||||
@@ -425,7 +429,7 @@ impl ChatRegistry {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if let Err(e) = task.await {
|
if let Err(e) = task.await {
|
||||||
this.update(cx, |_this, cx| {
|
this.update_in(cx, |_this, _window, cx| {
|
||||||
cx.emit(ChatEvent::Error(e.to_string()));
|
cx.emit(ChatEvent::Error(e.to_string()));
|
||||||
})?;
|
})?;
|
||||||
}
|
}
|
||||||
@@ -434,6 +438,7 @@ impl ChatRegistry {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Get all messages for the provided signer
|
||||||
/// Reload the chat registry, fetching messages and contact list from relays.
|
/// Reload the chat registry, fetching messages and contact list from relays.
|
||||||
pub fn reload(&mut self, cx: &mut Context<Self>) {
|
pub fn reload(&mut self, cx: &mut Context<Self>) {
|
||||||
self.reset(cx);
|
self.reset(cx);
|
||||||
@@ -638,13 +643,13 @@ impl ChatRegistry {
|
|||||||
self.tasks.push(cx.spawn(async move |this, cx| {
|
self.tasks.push(cx.spawn(async move |this, cx| {
|
||||||
match task.await {
|
match task.await {
|
||||||
Ok(rooms) => {
|
Ok(rooms) => {
|
||||||
this.update(cx, |this, cx| {
|
this.update_in(cx, |this, _window, cx| {
|
||||||
this.extend_rooms(rooms, cx);
|
this.extend_rooms(rooms, cx);
|
||||||
this.sort(cx);
|
this.sort(cx);
|
||||||
})?;
|
})?;
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
this.update(cx, |_, cx| {
|
this.update_in(cx, |_, _window, cx| {
|
||||||
cx.emit(ChatEvent::Error(e.to_string()));
|
cx.emit(ChatEvent::Error(e.to_string()));
|
||||||
})?;
|
})?;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -279,7 +279,7 @@ impl ChatPanel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.update(cx, |_, cx| cx.notify()).ok();
|
this.update_in(cx, |_, _window, cx| cx.notify()).ok();
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}));
|
}));
|
||||||
@@ -336,8 +336,10 @@ impl ChatPanel {
|
|||||||
self.tasks.push(cx.spawn(async move |this, cx| {
|
self.tasks.push(cx.spawn(async move |this, cx| {
|
||||||
let events = get_messages.await?;
|
let events = get_messages.await?;
|
||||||
|
|
||||||
// Update message list
|
// Update message list. `update_in` (rather than `update`) routes
|
||||||
this.update(cx, |this, cx| {
|
// through a try-borrow: on wasm a task poll that lands while the
|
||||||
|
// app context is borrowed can't panic and kill this task.
|
||||||
|
this.update_in(cx, |this, _window, cx| {
|
||||||
this.insert_messages(&events, cx);
|
this.insert_messages(&events, cx);
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
@@ -479,7 +481,10 @@ impl ChatPanel {
|
|||||||
let mut sent_ids = sent_ids.lock().await;
|
let mut sent_ids = sent_ids.lock().await;
|
||||||
sent_ids.extend(outputs.iter().filter_map(|output| output.gift_wrap_id));
|
sent_ids.extend(outputs.iter().filter_map(|output| output.gift_wrap_id));
|
||||||
|
|
||||||
this.update(cx, |this, cx| {
|
// `update_in` (rather than `update`) routes through a try-borrow:
|
||||||
|
// on wasm a poll that lands while the app context is borrowed
|
||||||
|
// can't panic and kill this task.
|
||||||
|
this.update_in(cx, |this, _window, cx| {
|
||||||
this.insert_reports(id, outputs, cx);
|
this.insert_reports(id, outputs, cx);
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
@@ -650,7 +655,7 @@ impl ChatPanel {
|
|||||||
});
|
});
|
||||||
|
|
||||||
self.tasks.push(cx.spawn_in(window, async move |this, cx| {
|
self.tasks.push(cx.spawn_in(window, async move |this, cx| {
|
||||||
this.update(cx, |this, cx| {
|
this.update_in(cx, |this, _window, cx| {
|
||||||
this.set_uploading(true, cx);
|
this.set_uploading(true, cx);
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
|
|||||||
+11
-11
@@ -184,7 +184,7 @@ impl DeviceRegistry {
|
|||||||
}
|
}
|
||||||
// New response event from the master device
|
// New response event from the master device
|
||||||
Kind::Custom(4455) => {
|
Kind::Custom(4455) => {
|
||||||
this.update(cx, |this, cx| {
|
this.update_in(cx, |this, _window, cx| {
|
||||||
this.extract_encryption(event, cx);
|
this.extract_encryption(event, cx);
|
||||||
})?;
|
})?;
|
||||||
}
|
}
|
||||||
@@ -272,7 +272,7 @@ impl DeviceRegistry {
|
|||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
||||||
this.update(cx, |_this, cx| {
|
this.update_in(cx, |_this, _window, cx| {
|
||||||
cx.emit(DeviceEvent::NotSet);
|
cx.emit(DeviceEvent::NotSet);
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
@@ -287,13 +287,13 @@ impl DeviceRegistry {
|
|||||||
self.tasks.push(cx.spawn(async move |this, cx| {
|
self.tasks.push(cx.spawn(async move |this, cx| {
|
||||||
match task.await {
|
match task.await {
|
||||||
Ok(keys) => {
|
Ok(keys) => {
|
||||||
this.update(cx, |this, cx| {
|
this.update_in(cx, |this, _window, cx| {
|
||||||
this.set_signer(keys, cx);
|
this.set_signer(keys, cx);
|
||||||
this.wait_for_request(cx);
|
this.wait_for_request(cx);
|
||||||
})?;
|
})?;
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
this.update(cx, |_this, cx| {
|
this.update_in(cx, |_this, _window, cx| {
|
||||||
cx.emit(DeviceEvent::error(e.to_string()));
|
cx.emit(DeviceEvent::error(e.to_string()));
|
||||||
})?;
|
})?;
|
||||||
}
|
}
|
||||||
@@ -358,12 +358,12 @@ impl DeviceRegistry {
|
|||||||
|
|
||||||
self.tasks.push(cx.spawn(async move |this, cx| {
|
self.tasks.push(cx.spawn(async move |this, cx| {
|
||||||
if let Ok(keys) = task.await {
|
if let Ok(keys) = task.await {
|
||||||
this.update(cx, |this, cx| {
|
this.update_in(cx, |this, _window, cx| {
|
||||||
this.set_signer(keys, cx);
|
this.set_signer(keys, cx);
|
||||||
this.wait_for_request(cx);
|
this.wait_for_request(cx);
|
||||||
})?;
|
})?;
|
||||||
} else {
|
} else {
|
||||||
this.update(cx, |this, cx| {
|
this.update_in(cx, |this, _window, cx| {
|
||||||
this.request(cx);
|
this.request(cx);
|
||||||
})?;
|
})?;
|
||||||
}
|
}
|
||||||
@@ -439,17 +439,17 @@ impl DeviceRegistry {
|
|||||||
self.tasks.push(cx.spawn(async move |this, cx| {
|
self.tasks.push(cx.spawn(async move |this, cx| {
|
||||||
match task.await {
|
match task.await {
|
||||||
Ok(Some(event)) => {
|
Ok(Some(event)) => {
|
||||||
this.update(cx, |this, cx| {
|
this.update_in(cx, |this, _window, cx| {
|
||||||
this.extract_encryption(event, cx);
|
this.extract_encryption(event, cx);
|
||||||
})?;
|
})?;
|
||||||
}
|
}
|
||||||
Ok(None) => {
|
Ok(None) => {
|
||||||
this.update(cx, |this, cx| {
|
this.update_in(cx, |this, _window, cx| {
|
||||||
this.wait_for_approval(cx);
|
this.wait_for_approval(cx);
|
||||||
})?;
|
})?;
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
this.update(cx, |_this, cx| {
|
this.update_in(cx, |_this, _window, cx| {
|
||||||
cx.emit(DeviceEvent::error(e.to_string()));
|
cx.emit(DeviceEvent::error(e.to_string()));
|
||||||
})?;
|
})?;
|
||||||
}
|
}
|
||||||
@@ -508,12 +508,12 @@ impl DeviceRegistry {
|
|||||||
self.tasks.push(cx.spawn(async move |this, cx| {
|
self.tasks.push(cx.spawn(async move |this, cx| {
|
||||||
match task.await {
|
match task.await {
|
||||||
Ok(keys) => {
|
Ok(keys) => {
|
||||||
this.update(cx, |this, cx| {
|
this.update_in(cx, |this, _window, cx| {
|
||||||
this.set_signer(keys, cx);
|
this.set_signer(keys, cx);
|
||||||
})?;
|
})?;
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
this.update(cx, |_this, cx| {
|
this.update_in(cx, |_this, _window, cx| {
|
||||||
cx.emit(DeviceEvent::error(e.to_string()));
|
cx.emit(DeviceEvent::error(e.to_string()));
|
||||||
})?;
|
})?;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,7 +80,11 @@ impl PersonRegistry {
|
|||||||
|
|
||||||
tasks.push(cx.spawn(async move |this, cx| {
|
tasks.push(cx.spawn(async move |this, cx| {
|
||||||
while let Ok(event) = rx.recv_async().await {
|
while let Ok(event) = rx.recv_async().await {
|
||||||
this.update(cx, |this, cx| {
|
// `update_in` (rather than `update`) routes through a
|
||||||
|
// try-borrow: on wasm a task poll that lands while the app
|
||||||
|
// context is borrowed can't panic and kill this consumer
|
||||||
|
// (which would stall the whole metadata pipeline).
|
||||||
|
this.update_in(cx, |this, _window, cx| {
|
||||||
// Drain the whole queue in a single update so a burst of
|
// Drain the whole queue in a single update so a burst of
|
||||||
// events collapses into one repaint instead of one per
|
// events collapses into one repaint instead of one per
|
||||||
// event (important on wasm, where everything runs on the
|
// event (important on wasm, where everything runs on the
|
||||||
@@ -231,7 +235,7 @@ impl PersonRegistry {
|
|||||||
|
|
||||||
self.tasks.push(cx.spawn(async move |this, cx| {
|
self.tasks.push(cx.spawn(async move |this, cx| {
|
||||||
if let Ok(persons) = task.await {
|
if let Ok(persons) = task.await {
|
||||||
this.update(cx, |this, cx| {
|
this.update_in(cx, |this, _window, cx| {
|
||||||
this.bulk_insert(persons, cx);
|
this.bulk_insert(persons, cx);
|
||||||
})
|
})
|
||||||
.ok();
|
.ok();
|
||||||
|
|||||||
@@ -105,20 +105,6 @@ impl Person {
|
|||||||
|
|
||||||
/// Get profile avatar
|
/// Get profile avatar
|
||||||
pub fn avatar(&self) -> SharedString {
|
pub fn avatar(&self) -> SharedString {
|
||||||
// On web, the browser blocks cross-origin image fetches unless the
|
|
||||||
// picture host sends CORS headers, so remote avatars can never load
|
|
||||||
// there. Each doomed fetch still triggers a full-window repaint when
|
|
||||||
// it fails, which is very costly on wasm's single main thread when a
|
|
||||||
// list renders many avatars at once. Fall back to the bundled avatar
|
|
||||||
// for remote pictures on web.
|
|
||||||
#[cfg(target_arch = "wasm32")]
|
|
||||||
if let Some(picture) = self.metadata.picture.as_ref()
|
|
||||||
&& !picture.is_empty()
|
|
||||||
&& url::Url::parse(picture).is_ok_and(|url| matches!(url.scheme(), "http" | "https"))
|
|
||||||
{
|
|
||||||
return "brand/avatar.png".into();
|
|
||||||
}
|
|
||||||
|
|
||||||
self.metadata
|
self.metadata
|
||||||
.picture
|
.picture
|
||||||
.as_ref()
|
.as_ref()
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ impl NostrRegistry {
|
|||||||
let task = cx.spawn(async move |this, cx| {
|
let task = cx.spawn(async move |this, cx| {
|
||||||
match new_signer.get_public_key_async().await {
|
match new_signer.get_public_key_async().await {
|
||||||
Ok(public_key) => {
|
Ok(public_key) => {
|
||||||
this.update(cx, |this, cx| {
|
this.update_in(cx, |this, _window, cx| {
|
||||||
this.signer.swap_inner(new_signer);
|
this.signer.swap_inner(new_signer);
|
||||||
this.current_user = Some(public_key);
|
this.current_user = Some(public_key);
|
||||||
cx.emit(StateEvent::SignerChanged);
|
cx.emit(StateEvent::SignerChanged);
|
||||||
@@ -189,7 +189,7 @@ impl NostrRegistry {
|
|||||||
})?;
|
})?;
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
this.update(cx, |_this, cx| {
|
this.update_in(cx, |_this, _window, cx| {
|
||||||
cx.emit(StateEvent::error(e.to_string()));
|
cx.emit(StateEvent::error(e.to_string()));
|
||||||
})?;
|
})?;
|
||||||
}
|
}
|
||||||
@@ -226,7 +226,7 @@ impl NostrRegistry {
|
|||||||
|
|
||||||
self.tasks.push(cx.spawn(async move |this, cx| {
|
self.tasks.push(cx.spawn(async move |this, cx| {
|
||||||
if let Err(e) = task.await {
|
if let Err(e) = task.await {
|
||||||
this.update(cx, |_this, cx| {
|
this.update_in(cx, |_this, _window, cx| {
|
||||||
cx.emit(StateEvent::error(e.to_string()));
|
cx.emit(StateEvent::error(e.to_string()));
|
||||||
})?;
|
})?;
|
||||||
}
|
}
|
||||||
@@ -248,7 +248,7 @@ impl NostrRegistry {
|
|||||||
let secret_key = SecretKey::parse(&content)?;
|
let secret_key = SecretKey::parse(&content)?;
|
||||||
let keys = Keys::new(secret_key);
|
let keys = Keys::new(secret_key);
|
||||||
|
|
||||||
this.update(cx, |this, cx| {
|
this.update_in(cx, |this, _window, cx| {
|
||||||
this.set_signer(keys, cx);
|
this.set_signer(keys, cx);
|
||||||
cx.notify();
|
cx.notify();
|
||||||
})?;
|
})?;
|
||||||
@@ -263,19 +263,19 @@ impl NostrRegistry {
|
|||||||
// Handle auth url with the default browser
|
// Handle auth url with the default browser
|
||||||
signer.auth_url_handler(CoopAuthUrlHandler);
|
signer.auth_url_handler(CoopAuthUrlHandler);
|
||||||
|
|
||||||
this.update(cx, |this, cx| {
|
this.update_in(cx, |this, _window, cx| {
|
||||||
this.set_signer(signer, cx);
|
this.set_signer(signer, cx);
|
||||||
cx.notify();
|
cx.notify();
|
||||||
})?;
|
})?;
|
||||||
} else if content == "proxy" {
|
} else if content == "proxy" {
|
||||||
#[cfg(not(target_arch = "wasm32"))]
|
#[cfg(not(target_arch = "wasm32"))]
|
||||||
this.update(cx, |this, cx| {
|
this.update_in(cx, |this, _window, cx| {
|
||||||
this.connect_proxy(cx);
|
this.connect_proxy(cx);
|
||||||
})?;
|
})?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
this.update(cx, |_, cx| {
|
this.update_in(cx, |_, _window, cx| {
|
||||||
cx.emit(StateEvent::NoSigner);
|
cx.emit(StateEvent::NoSigner);
|
||||||
})?;
|
})?;
|
||||||
}
|
}
|
||||||
@@ -352,7 +352,7 @@ impl NostrRegistry {
|
|||||||
let proxy = proxy.clone();
|
let proxy = proxy.clone();
|
||||||
async move |this, cx| {
|
async move |this, cx| {
|
||||||
while let Ok(url) = rx.recv_async().await {
|
while let Ok(url) = rx.recv_async().await {
|
||||||
this.update(cx, |this, cx| {
|
this.update_in(cx, |this, _window, cx| {
|
||||||
let save = cx.write_credentials(USER_KEYRING, "proxy", b"proxy");
|
let save = cx.write_credentials(USER_KEYRING, "proxy", b"proxy");
|
||||||
cx.background_spawn(async move { save.await.ok() }).detach();
|
cx.background_spawn(async move { save.await.ok() }).detach();
|
||||||
cx.open_url(&url);
|
cx.open_url(&url);
|
||||||
@@ -374,7 +374,7 @@ impl NostrRegistry {
|
|||||||
loop {
|
loop {
|
||||||
executor.timer(Duration::from_secs(5)).await;
|
executor.timer(Duration::from_secs(5)).await;
|
||||||
if !proxy.is_session_active() {
|
if !proxy.is_session_active() {
|
||||||
_ = this.update(cx, |this, cx| {
|
_ = this.update_in(cx, |this, _window, cx| {
|
||||||
// Only notify if this proxy is still the active signer
|
// Only notify if this proxy is still the active signer
|
||||||
if this.current_user.is_some() {
|
if this.current_user.is_some() {
|
||||||
this.signer.swap_inner(Keys::generate());
|
this.signer.swap_inner(Keys::generate());
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use instant::Duration;
|
|
||||||
|
|
||||||
use gpui::prelude::FluentBuilder as _;
|
use gpui::prelude::FluentBuilder as _;
|
||||||
use gpui::{
|
use gpui::{
|
||||||
div, px, relative, rems, svg, Animation, AnimationExt, AnyElement, App, Div, ElementId,
|
Animation, AnimationExt, AnyElement, App, Div, ElementId, InteractiveElement, IntoElement,
|
||||||
InteractiveElement, IntoElement, ParentElement, RenderOnce, SharedString,
|
ParentElement, RenderOnce, SharedString, StatefulInteractiveElement, StyleRefinement, Styled,
|
||||||
StatefulInteractiveElement, StyleRefinement, Styled, Window,
|
Window, div, px, relative, rems, svg,
|
||||||
};
|
};
|
||||||
|
use instant::Duration;
|
||||||
use theme::ActiveTheme;
|
use theme::ActiveTheme;
|
||||||
|
|
||||||
use crate::icon::IconNamed;
|
use crate::icon::IconNamed;
|
||||||
use crate::{v_flex, Disableable, IconName, Selectable, Sizable, Size, StyledExt as _};
|
use crate::{Disableable, IconName, Selectable, Sizable, Size, StyledExt as _, v_flex};
|
||||||
|
|
||||||
/// A Checkbox element.
|
/// A Checkbox element.
|
||||||
#[allow(clippy::type_complexity)]
|
#[allow(clippy::type_complexity)]
|
||||||
@@ -172,10 +172,16 @@ pub(crate) fn checkbox_check_icon(
|
|||||||
if !disabled && checked != *toggle_state.read(cx) {
|
if !disabled && checked != *toggle_state.read(cx) {
|
||||||
let duration = Duration::from_secs_f64(0.25);
|
let duration = Duration::from_secs_f64(0.25);
|
||||||
cx.spawn({
|
cx.spawn({
|
||||||
let toggle_state = toggle_state.clone();
|
let toggle_state = toggle_state.downgrade();
|
||||||
async move |cx| {
|
async move |cx| {
|
||||||
cx.background_executor().timer(duration).await;
|
cx.background_executor().timer(duration).await;
|
||||||
toggle_state.update(cx, |this, _| *this = checked);
|
// `update_in` (rather than `update`) routes through a
|
||||||
|
// try-borrow: on wasm a task poll that lands while
|
||||||
|
// the app context is borrowed can't panic and kill
|
||||||
|
// this task.
|
||||||
|
toggle_state
|
||||||
|
.update_in(cx, |this, _window, _| *this = checked)
|
||||||
|
.ok();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.detach();
|
.detach();
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
use instant::Duration;
|
|
||||||
|
|
||||||
use gpui::{Context, Pixels, Task, px};
|
use gpui::{Context, Pixels, Task, px};
|
||||||
|
use instant::Duration;
|
||||||
|
|
||||||
static INTERVAL: Duration = Duration::from_millis(500);
|
static INTERVAL: Duration = Duration::from_millis(500);
|
||||||
static PAUSE_DELAY: Duration = Duration::from_millis(300);
|
static PAUSE_DELAY: Duration = Duration::from_millis(300);
|
||||||
@@ -63,9 +62,11 @@ impl BlinkCursor {
|
|||||||
let epoch = self.next_epoch();
|
let epoch = self.next_epoch();
|
||||||
self._task = cx.spawn(async move |this, cx| {
|
self._task = cx.spawn(async move |this, cx| {
|
||||||
cx.background_executor().timer(INTERVAL).await;
|
cx.background_executor().timer(INTERVAL).await;
|
||||||
if let Some(this) = this.upgrade() {
|
// `update_in` (rather than `update`) routes through a try-borrow:
|
||||||
this.update(cx, |this, cx| this.blink(epoch, cx));
|
// on wasm a task poll that lands while the app context is
|
||||||
}
|
// borrowed can't panic and kill this recurring task.
|
||||||
|
this.update_in(cx, |this, _window, cx| this.blink(epoch, cx))
|
||||||
|
.ok();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,12 +86,11 @@ impl BlinkCursor {
|
|||||||
self._task = cx.spawn(async move |this, cx| {
|
self._task = cx.spawn(async move |this, cx| {
|
||||||
cx.background_executor().timer(PAUSE_DELAY).await;
|
cx.background_executor().timer(PAUSE_DELAY).await;
|
||||||
|
|
||||||
if let Some(this) = this.upgrade() {
|
this.update_in(cx, |this, _window, cx| {
|
||||||
this.update(cx, |this, cx| {
|
|
||||||
this.paused = false;
|
this.paused = false;
|
||||||
this.blink(epoch, cx);
|
this.blink(epoch, cx);
|
||||||
});
|
})
|
||||||
}
|
.ok();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ impl ImportIdentity {
|
|||||||
})?;
|
})?;
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
this.update(cx, |this, cx| {
|
this.update_in(cx, |this, _window, cx| {
|
||||||
this.set_error(e.to_string(), cx);
|
this.set_error(e.to_string(), cx);
|
||||||
})?;
|
})?;
|
||||||
}
|
}
|
||||||
@@ -198,7 +198,7 @@ impl ImportIdentity {
|
|||||||
self.tasks.push(cx.spawn(async move |this, cx| {
|
self.tasks.push(cx.spawn(async move |this, cx| {
|
||||||
cx.background_executor().timer(Duration::from_secs(3)).await;
|
cx.background_executor().timer(Duration::from_secs(3)).await;
|
||||||
|
|
||||||
this.update(cx, |this, cx| {
|
this.update_in(cx, |this, _window, cx| {
|
||||||
this.error.update(cx, |this, cx| {
|
this.error.update(cx, |this, cx| {
|
||||||
*this = None;
|
*this = None;
|
||||||
cx.notify();
|
cx.notify();
|
||||||
@@ -271,7 +271,7 @@ impl Render for ImportIdentity {
|
|||||||
this.login(window, cx);
|
this.login(window, cx);
|
||||||
})),
|
})),
|
||||||
)
|
)
|
||||||
.when(cfg!(target_arch = "wasm32"), |this| this.child(divider(cx)))
|
.child(divider(cx))
|
||||||
.when(!is_wasm, |this| {
|
.when(!is_wasm, |this| {
|
||||||
this.child(
|
this.child(
|
||||||
Button::new("proxy")
|
Button::new("proxy")
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ impl RestoreEncryption {
|
|||||||
self.tasks.push(cx.spawn(async move |this, cx| {
|
self.tasks.push(cx.spawn(async move |this, cx| {
|
||||||
cx.background_executor().timer(Duration::from_secs(3)).await;
|
cx.background_executor().timer(Duration::from_secs(3)).await;
|
||||||
|
|
||||||
this.update(cx, |this, cx| {
|
this.update_in(cx, |this, _window, cx| {
|
||||||
this.error.update(cx, |this, cx| {
|
this.error.update(cx, |this, cx| {
|
||||||
*this = None;
|
*this = None;
|
||||||
cx.notify();
|
cx.notify();
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ impl Screening {
|
|||||||
self.tasks.push(cx.spawn(async move |this, cx| {
|
self.tasks.push(cx.spawn(async move |this, cx| {
|
||||||
let result = task.await.unwrap_or(false);
|
let result = task.await.unwrap_or(false);
|
||||||
|
|
||||||
this.update(cx, |this, cx| {
|
this.update_in(cx, |this, _window, cx| {
|
||||||
this.followed = result;
|
this.followed = result;
|
||||||
cx.notify();
|
cx.notify();
|
||||||
})
|
})
|
||||||
@@ -139,7 +139,7 @@ impl Screening {
|
|||||||
self.tasks.push(cx.spawn(async move |this, cx| {
|
self.tasks.push(cx.spawn(async move |this, cx| {
|
||||||
match task.await {
|
match task.await {
|
||||||
Ok(contacts) => {
|
Ok(contacts) => {
|
||||||
this.update(cx, |this, cx| {
|
this.update_in(cx, |this, _window, cx| {
|
||||||
this.mutual_contacts = contacts;
|
this.mutual_contacts = contacts;
|
||||||
cx.notify();
|
cx.notify();
|
||||||
})
|
})
|
||||||
@@ -185,7 +185,7 @@ impl Screening {
|
|||||||
self.tasks.push(cx.spawn(async move |this, cx| {
|
self.tasks.push(cx.spawn(async move |this, cx| {
|
||||||
let result = task.await;
|
let result = task.await;
|
||||||
|
|
||||||
this.update(cx, |this, cx| {
|
this.update_in(cx, |this, _window, cx| {
|
||||||
this.last_active = result;
|
this.last_active = result;
|
||||||
cx.notify();
|
cx.notify();
|
||||||
})
|
})
|
||||||
@@ -208,7 +208,7 @@ impl Screening {
|
|||||||
self.tasks.push(cx.spawn(async move |this, cx| {
|
self.tasks.push(cx.spawn(async move |this, cx| {
|
||||||
let result = task.await.unwrap_or(false);
|
let result = task.await.unwrap_or(false);
|
||||||
|
|
||||||
this.update(cx, |this, cx| {
|
this.update_in(cx, |this, _window, cx| {
|
||||||
this.verified = result;
|
this.verified = result;
|
||||||
cx.notify();
|
cx.notify();
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ impl BackupPanel {
|
|||||||
cx.background_executor().timer(Duration::from_secs(2)).await;
|
cx.background_executor().timer(Duration::from_secs(2)).await;
|
||||||
|
|
||||||
// Clear the error message after a delay
|
// Clear the error message after a delay
|
||||||
this.update(cx, |this, cx| {
|
this.update_in(cx, |this, _window, cx| {
|
||||||
this.set_copied(false, cx);
|
this.set_copied(false, cx);
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
|
|||||||
@@ -108,8 +108,10 @@ impl ContactListPanel {
|
|||||||
self.tasks.push(cx.spawn_in(window, async move |this, cx| {
|
self.tasks.push(cx.spawn_in(window, async move |this, cx| {
|
||||||
let public_keys = task.await?;
|
let public_keys = task.await?;
|
||||||
|
|
||||||
// Update state
|
// Update state. `update_in` (rather than `update`) routes through
|
||||||
this.update(cx, |this, cx| {
|
// a try-borrow, so on wasm a poll that happens to land while the
|
||||||
|
// app context is borrowed can't panic and kill this task.
|
||||||
|
this.update_in(cx, |this, _window, cx| {
|
||||||
this.contacts.extend(public_keys);
|
this.contacts.extend(public_keys);
|
||||||
cx.notify();
|
cx.notify();
|
||||||
})?;
|
})?;
|
||||||
@@ -148,8 +150,11 @@ impl ContactListPanel {
|
|||||||
self.tasks.push(cx.spawn_in(window, async move |this, cx| {
|
self.tasks.push(cx.spawn_in(window, async move |this, cx| {
|
||||||
cx.background_executor().timer(Duration::from_secs(2)).await;
|
cx.background_executor().timer(Duration::from_secs(2)).await;
|
||||||
|
|
||||||
// Clear the error message after a delay
|
// Clear the error message after a delay. `update_in` (rather than
|
||||||
this.update(cx, |this, cx| {
|
// `update`) routes through a try-borrow, so on wasm a poll that
|
||||||
|
// happens to land while the app context is borrowed can't panic
|
||||||
|
// and kill this task.
|
||||||
|
this.update_in(cx, |this, _window, cx| {
|
||||||
this.error = None;
|
this.error = None;
|
||||||
cx.notify();
|
cx.notify();
|
||||||
})?;
|
})?;
|
||||||
|
|||||||
@@ -103,8 +103,10 @@ impl MessagingRelayPanel {
|
|||||||
self.tasks.push(cx.spawn_in(window, async move |this, cx| {
|
self.tasks.push(cx.spawn_in(window, async move |this, cx| {
|
||||||
let relays = task.await?;
|
let relays = task.await?;
|
||||||
|
|
||||||
// Update state
|
// Update state. `update_in` (rather than `update`) routes through
|
||||||
this.update(cx, |this, cx| {
|
// a try-borrow: on wasm a poll that lands while the app context
|
||||||
|
// is borrowed can't panic and kill this task.
|
||||||
|
this.update_in(cx, |this, _window, cx| {
|
||||||
this.relays.extend(relays);
|
this.relays.extend(relays);
|
||||||
cx.notify();
|
cx.notify();
|
||||||
})?;
|
})?;
|
||||||
@@ -148,8 +150,11 @@ impl MessagingRelayPanel {
|
|||||||
self.tasks.push(cx.spawn_in(window, async move |this, cx| {
|
self.tasks.push(cx.spawn_in(window, async move |this, cx| {
|
||||||
cx.background_executor().timer(Duration::from_secs(2)).await;
|
cx.background_executor().timer(Duration::from_secs(2)).await;
|
||||||
|
|
||||||
// Clear the error message after a delay
|
// Clear the error message after a delay. `update_in` (rather than
|
||||||
this.update(cx, |this, cx| {
|
// `update`) routes through a try-borrow: on wasm a poll that
|
||||||
|
// lands while the app context is borrowed can't panic and kill
|
||||||
|
// this task.
|
||||||
|
this.update_in(cx, |this, _window, cx| {
|
||||||
this.error = None;
|
this.error = None;
|
||||||
cx.notify();
|
cx.notify();
|
||||||
})?;
|
})?;
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ impl ProfilePanel {
|
|||||||
});
|
});
|
||||||
|
|
||||||
self.tasks.push(cx.spawn_in(window, async move |this, cx| {
|
self.tasks.push(cx.spawn_in(window, async move |this, cx| {
|
||||||
this.update(cx, |this, cx| {
|
this.update_in(cx, |this, _window, cx| {
|
||||||
this.set_uploading(true, cx);
|
this.set_uploading(true, cx);
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
|
|||||||
@@ -121,8 +121,10 @@ impl RelayListPanel {
|
|||||||
self.tasks.push(cx.spawn_in(window, async move |this, cx| {
|
self.tasks.push(cx.spawn_in(window, async move |this, cx| {
|
||||||
let relays = task.await?;
|
let relays = task.await?;
|
||||||
|
|
||||||
// Update state
|
// Update state. `update_in` (rather than `update`) routes through
|
||||||
this.update(cx, |this, cx| {
|
// a try-borrow: on wasm a poll that lands while the app context
|
||||||
|
// is borrowed can't panic and kill this task.
|
||||||
|
this.update_in(cx, |this, _window, cx| {
|
||||||
this.relays.extend(relays);
|
this.relays.extend(relays);
|
||||||
cx.notify();
|
cx.notify();
|
||||||
})?;
|
})?;
|
||||||
@@ -167,8 +169,11 @@ impl RelayListPanel {
|
|||||||
self.tasks.push(cx.spawn_in(window, async move |this, cx| {
|
self.tasks.push(cx.spawn_in(window, async move |this, cx| {
|
||||||
cx.background_executor().timer(Duration::from_secs(2)).await;
|
cx.background_executor().timer(Duration::from_secs(2)).await;
|
||||||
|
|
||||||
// Clear the error message after a delay
|
// Clear the error message after a delay. `update_in` (rather than
|
||||||
this.update(cx, |this, cx| {
|
// `update`) routes through a try-borrow: on wasm a poll that
|
||||||
|
// lands while the app context is borrowed can't panic and kill
|
||||||
|
// this task.
|
||||||
|
this.update_in(cx, |this, _window, cx| {
|
||||||
this.error = None;
|
this.error = None;
|
||||||
cx.notify();
|
cx.notify();
|
||||||
})?;
|
})?;
|
||||||
|
|||||||
@@ -178,7 +178,10 @@ impl Sidebar {
|
|||||||
self.tasks.push(cx.spawn_in(window, async move |this, cx| {
|
self.tasks.push(cx.spawn_in(window, async move |this, cx| {
|
||||||
match task.await {
|
match task.await {
|
||||||
Ok(contacts) => {
|
Ok(contacts) => {
|
||||||
this.update(cx, |this, cx| {
|
// `update_in` (rather than `update`) routes through a
|
||||||
|
// try-borrow: on wasm a poll that lands while the app
|
||||||
|
// context is borrowed can't panic and kill this task.
|
||||||
|
this.update_in(cx, |this, _window, cx| {
|
||||||
this.set_contact_list(contacts, cx);
|
this.set_contact_list(contacts, cx);
|
||||||
})?;
|
})?;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -32,7 +32,7 @@ console_log = "1.0"
|
|||||||
wasm-bindgen = "0.2"
|
wasm-bindgen = "0.2"
|
||||||
wasm-bindgen-futures = "0.4"
|
wasm-bindgen-futures = "0.4"
|
||||||
js-sys = "0.3"
|
js-sys = "0.3"
|
||||||
web-sys = { version = "0.3", features = ["Window", "Performance"] }
|
web-sys = { version = "0.3", features = ["Window", "Performance", "console", "DomException"] }
|
||||||
universal-time = { git = "https://github.com/shadowylab/universal-time" }
|
universal-time = { git = "https://github.com/shadowylab/universal-time" }
|
||||||
|
|
||||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||||
|
|||||||
@@ -36,6 +36,11 @@ if [[ "$(uname)" == "Darwin" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Step 1: Build WASM
|
# Step 1: Build WASM
|
||||||
|
#
|
||||||
|
# Single-threaded build: `+bulk-memory` only. The multithreaded web backend
|
||||||
|
# is disabled in `web/src/lib.rs` (gpui's wasm workers freeze their JS event
|
||||||
|
# loop in `Atomics.wait`, which breaks nostr-sdk's spawn_local-driven client
|
||||||
|
# and the WebSocket transport), so no atomics/shared-memory flags here.
|
||||||
echo -e "${GREEN}Step 1: Building WASM...${NC}"
|
echo -e "${GREEN}Step 1: Building WASM...${NC}"
|
||||||
cd "$PROJECT_ROOT"
|
cd "$PROJECT_ROOT"
|
||||||
export CARGO_TARGET_DIR="$PROJECT_ROOT/target"
|
export CARGO_TARGET_DIR="$PROJECT_ROOT/target"
|
||||||
|
|||||||
+26
-2
@@ -69,8 +69,6 @@ pub fn set_theme(dark: bool) {
|
|||||||
|
|
||||||
#[wasm_bindgen]
|
#[wasm_bindgen]
|
||||||
pub async fn run() -> Result<(), JsValue> {
|
pub async fn run() -> Result<(), JsValue> {
|
||||||
console_error_panic_hook::set_once();
|
|
||||||
|
|
||||||
// Initialize logging to browser console
|
// Initialize logging to browser console
|
||||||
console_log::init_with_level(log::Level::Info).expect("Failed to initialize logger");
|
console_log::init_with_level(log::Level::Info).expect("Failed to initialize logger");
|
||||||
|
|
||||||
@@ -80,6 +78,26 @@ pub async fn run() -> Result<(), JsValue> {
|
|||||||
#[cfg(target_family = "wasm")]
|
#[cfg(target_family = "wasm")]
|
||||||
gpui_platform::web_init();
|
gpui_platform::web_init();
|
||||||
|
|
||||||
|
// Install the panic hook AFTER `web_init` (which sets the default
|
||||||
|
// `console_error_panic_hook`), so ours wins. It prints the entire
|
||||||
|
// JS/wasm stack as a single string: `console_error_panic_hook`'s default
|
||||||
|
// output is an `Error` object whose stack is collapsed in the console,
|
||||||
|
// and on wasm the frames below the panic machinery name the task that
|
||||||
|
// panicked (debug builds keep symbol names) — essential for diagnosing
|
||||||
|
// `RefCell already borrowed`.
|
||||||
|
#[cfg(target_family = "wasm")]
|
||||||
|
std::panic::set_hook(Box::new(|info| {
|
||||||
|
// Capture the JS stack (which includes the wasm frames with symbol
|
||||||
|
// names in debug builds) without constructing DOM objects.
|
||||||
|
let stack = js_sys::Reflect::get(&js_sys::Error::new(""), &"stack".into())
|
||||||
|
.ok()
|
||||||
|
.and_then(|v| v.as_string())
|
||||||
|
.unwrap_or_default();
|
||||||
|
web_sys::console::error_1(
|
||||||
|
&format!("{info}\n\n==== full stack ====\n{stack}\n=====================").into(),
|
||||||
|
);
|
||||||
|
}));
|
||||||
|
|
||||||
#[cfg(not(target_family = "wasm"))]
|
#[cfg(not(target_family = "wasm"))]
|
||||||
let app = gpui_platform::application();
|
let app = gpui_platform::application();
|
||||||
|
|
||||||
@@ -96,6 +114,12 @@ pub async fn run() -> Result<(), JsValue> {
|
|||||||
// immediately instead of waiting for a repaint.
|
// immediately instead of waiting for a repaint.
|
||||||
assets.preload().await;
|
assets.preload().await;
|
||||||
|
|
||||||
|
// NOTE: the multithreaded web backend (application_with_web_backend)
|
||||||
|
// cannot host this app's backend. gpui's wasm background workers
|
||||||
|
// block on `Atomics.wait` while idle, freezing their JS event loop,
|
||||||
|
// so `spawn_local`-driven tasks (nostr-sdk's client actor, the
|
||||||
|
// WebSocket transport) and fetch promises never make progress on a
|
||||||
|
// worker thread. Everything must run on the main thread.
|
||||||
gpui_platform::single_threaded_web().with_assets(assets)
|
gpui_platform::single_threaded_web().with_assets(assets)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user