From 62dadd96a857af27e9b79806c03bfb16a8ed4a48 Mon Sep 17 00:00:00 2001 From: Kiril Videlov Date: Mon, 13 May 2024 14:18:56 +0200 Subject: [PATCH] remove unused index subscription --- app/src/lib/backend/indexes.ts | 11 ----------- crates/gitbutler-tauri/src/watcher.rs | 5 ----- crates/gitbutler-watcher/src/events.rs | 1 - crates/gitbutler-watcher/src/handler/mod.rs | 4 +--- 4 files changed, 1 insertion(+), 20 deletions(-) delete mode 100644 app/src/lib/backend/indexes.ts diff --git a/app/src/lib/backend/indexes.ts b/app/src/lib/backend/indexes.ts deleted file mode 100644 index 5d7f42568..000000000 --- a/app/src/lib/backend/indexes.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { listen } from '$lib/backend/ipc'; - -export function subscribe( - params: { projectId: string }, - callback: (params: { projectId: string }) => Promise -) { - return listen( - `project://${params.projectId}/git/index`, - async () => await callback({ ...params }) - ); -} diff --git a/crates/gitbutler-tauri/src/watcher.rs b/crates/gitbutler-tauri/src/watcher.rs index b917d449f..c6406a596 100644 --- a/crates/gitbutler-tauri/src/watcher.rs +++ b/crates/gitbutler-tauri/src/watcher.rs @@ -24,11 +24,6 @@ mod event { impl From for ChangeForFrontend { fn from(value: Change) -> Self { match value { - Change::GitIndex(project_id) => ChangeForFrontend { - name: format!("project://{}/git/index", project_id), - payload: serde_json::json!({}), - project_id, - }, Change::GitFetch(project_id) => ChangeForFrontend { name: format!("project://{}/git/fetch", project_id), payload: serde_json::json!({}), diff --git a/crates/gitbutler-watcher/src/events.rs b/crates/gitbutler-watcher/src/events.rs index aa8f78eac..fe81fec63 100644 --- a/crates/gitbutler-watcher/src/events.rs +++ b/crates/gitbutler-watcher/src/events.rs @@ -85,7 +85,6 @@ fn comma_separated_paths(paths: &[PathBuf]) -> String { #[derive(Debug, Clone)] #[allow(missing_docs)] pub enum Change { - GitIndex(ProjectId), GitFetch(ProjectId), GitHead { project_id: ProjectId, diff --git a/crates/gitbutler-watcher/src/handler/mod.rs b/crates/gitbutler-watcher/src/handler/mod.rs index f7141bfc1..0d32affea 100644 --- a/crates/gitbutler-watcher/src/handler/mod.rs +++ b/crates/gitbutler-watcher/src/handler/mod.rs @@ -60,6 +60,7 @@ impl Handler { .await .context("failed to handle git file change event"), + // This is only produced at the end of mutating Tauri commands to trigger a fresh state being served to the UI. events::InternalEvent::CalculateVirtualBranches(project_id) => self .calculate_virtual_branches(project_id) .await @@ -175,9 +176,6 @@ impl Handler { })?; } } - "index" => { - self.emit_app_event(Change::GitIndex(project.id))?; - } _ => {} } }