chore: restructure ui components
This commit is contained in:
@@ -79,7 +79,7 @@ impl Backend {
|
||||
}
|
||||
|
||||
pub(crate) fn new(client: Client, signer: UniversalSigner, cx: &mut Context<Self>) -> Self {
|
||||
let weak = cx.entity().downgrade();
|
||||
let weak = cx.weak_entity();
|
||||
let pump_client = client.clone();
|
||||
|
||||
let pump: Task<Result<(), Error>> = cx.spawn(async move |this, cx| {
|
||||
|
||||
@@ -162,7 +162,7 @@ impl CheckoutsStore {
|
||||
}
|
||||
|
||||
if !cfg!(target_arch = "wasm32") {
|
||||
let weak = cx.entity().downgrade();
|
||||
let weak = cx.weak_entity();
|
||||
cx.defer(move |cx| {
|
||||
weak.update(cx, |this, cx| {
|
||||
this.refresh(cx);
|
||||
|
||||
@@ -28,7 +28,7 @@ impl LocalReposStore {
|
||||
}
|
||||
|
||||
pub fn new(roots: Vec<PathBuf>, cx: &mut Context<Self>) -> Self {
|
||||
let weak = cx.entity().downgrade();
|
||||
let weak = cx.weak_entity();
|
||||
cx.defer(move |cx| {
|
||||
if let Err(error) = weak.update(cx, |this, cx| this.rescan(cx)) {
|
||||
log::warn!("local repos store dropped before initial scan could run: {error}");
|
||||
|
||||
@@ -64,7 +64,7 @@ pub struct RepoStore {
|
||||
|
||||
impl RepoStore {
|
||||
pub fn new(addr: RepoAddr, hint: Option<Announcement>, cx: &mut Context<Self>) -> Self {
|
||||
let weak = cx.entity().downgrade();
|
||||
let weak = cx.weak_entity();
|
||||
let subscription = Self::subscribe_backend(cx);
|
||||
|
||||
let announced_relays = hint
|
||||
|
||||
@@ -50,7 +50,7 @@ impl RepoListStore {
|
||||
|
||||
pub fn new(cx: &mut Context<Self>) -> Self {
|
||||
let backend = Backend::global(cx);
|
||||
let weak = cx.entity().downgrade();
|
||||
let weak = cx.weak_entity();
|
||||
|
||||
let subscription = cx.subscribe(&backend, |this, _backend, event, cx| {
|
||||
let relevant = match event {
|
||||
|
||||
Reference in New Issue
Block a user