copy: the desktop's "P2P not running" lives in copy::p2p
It is the failure text a network action's row shows, so it belongs in copy.rs with the rest of the user-visible words (queued by G1, which gathered its twelve literals into network_task.rs). Wording unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
78dc8d5b8f
commit
a000dbebd3
2 files changed
+9
-5
No files matched your search
@@ -44,15 +44,13 @@ use std::future::Future;
|
||||
use std::sync::{Arc, Mutex, MutexGuard, PoisonError};
|
||||
|
||||
use gpui::{Context, Task};
|
||||
use synchronicity::copy::p2p;
|
||||
use synchronicity::jobs::runner::JobHandle;
|
||||
use synchronicity::node::NodeRuntime;
|
||||
use synchronicity::p2p::admission::EnsembleEndpoint;
|
||||
use tokio::runtime::Handle;
|
||||
use tokio::sync::watch;
|
||||
|
||||
/// What a network action reports when there is no P2P node to run it on.
|
||||
pub const P2P_NOT_RUNNING: &str = "P2P not running";
|
||||
|
||||
/// The task didn't run to completion: it panicked, or the runtime shut down
|
||||
/// under it. Distinct from the task's *own* error, which [`run`] passes
|
||||
/// through untouched.
|
||||
@@ -84,7 +82,7 @@ where
|
||||
|
||||
/// Run `work` against the P2P endpoint on the tokio runtime (see [`run`]), then
|
||||
/// hand its outcome to `done` on the view and repaint. With no node running the
|
||||
/// outcome is [`P2P_NOT_RUNNING`] and `work` never runs. Returns the task, to
|
||||
/// outcome is [`p2p::NOT_RUNNING`] and `work` never runs. Returns the task, to
|
||||
/// `detach()` or hold.
|
||||
pub fn on_endpoint<V: 'static, T: Send + 'static, F>(
|
||||
cx: &mut Context<V>,
|
||||
@@ -133,7 +131,7 @@ where
|
||||
let (endpoint, rt) = (node.endpoint(), rt.clone());
|
||||
cx.spawn(async move |this, cx| {
|
||||
let result = run_msg(&rt, async move {
|
||||
work(endpoint.ok_or_else(|| P2P_NOT_RUNNING.to_string())?).await
|
||||
work(endpoint.ok_or_else(|| p2p::NOT_RUNNING.to_string())?).await
|
||||
})
|
||||
.await;
|
||||
if let Some(job) = job {
|
||||
|
||||
@@ -2243,6 +2243,12 @@ pub mod clippings {
|
||||
pub const EDIT_PLACEHOLDER: &str = "A clipping cannot be empty";
|
||||
}
|
||||
|
||||
/// This node's P2P connection to the rest of the ensemble.
|
||||
pub mod p2p {
|
||||
/// What a network action reports when there is no P2P node to run it on.
|
||||
pub const NOT_RUNNING: &str = "P2P not running";
|
||||
}
|
||||
|
||||
/// Copy and display state for a content fetch in progress — one node opening
|
||||
/// something whose bytes live on another (`crate::content_fetch`). The state
|
||||
/// machine that decides which words apply lives here too, not just the
|
||||
|
||||
Reference in new issue
Block a user