diff --git a/app/src/lib/backend/sync.ts b/app/src/lib/backend/sync.ts deleted file mode 100644 index 2606c28b3..000000000 --- a/app/src/lib/backend/sync.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { invoke } from './ipc'; - -export async function syncToCloud(projectId: string | undefined) { - try { - if (projectId) await invoke('project_flush_and_push', { id: projectId }); - } catch (err: any) { - console.error(err); - } -} diff --git a/app/src/lib/components/SyncButton.svelte b/app/src/lib/components/SyncButton.svelte index 20ecc9f08..9806943d9 100644 --- a/app/src/lib/components/SyncButton.svelte +++ b/app/src/lib/components/SyncButton.svelte @@ -1,19 +1,15 @@ { e.preventDefault(); e.stopPropagation(); - if (cloudEnabled) syncToCloud(project.id); // don't wait for this await baseBranchService.fetchFromTarget('modal'); if (githubService.isEnabled) { await githubService.reload(); diff --git a/app/src/routes/[projectId]/+layout.svelte b/app/src/routes/[projectId]/+layout.svelte index 5b909a2c4..c75194a7d 100644 --- a/app/src/routes/[projectId]/+layout.svelte +++ b/app/src/routes/[projectId]/+layout.svelte @@ -1,6 +1,5 @@ diff --git a/crates/gitbutler-tauri/src/commands.rs b/crates/gitbutler-tauri/src/commands.rs index 214e03581..af2492b0a 100644 --- a/crates/gitbutler-tauri/src/commands.rs +++ b/crates/gitbutler-tauri/src/commands.rs @@ -1,14 +1,9 @@ -use anyhow::Context; -use gitbutler_core::{ - gb_repository, git, project_repository, - projects::{self, ProjectId}, - users, -}; +use gitbutler_core::{git, projects::ProjectId}; use tauri::Manager; use tracing::instrument; +use crate::app; use crate::error::Error; -use crate::{app, watcher}; #[tauri::command(async)] #[instrument(skip(handle), err(Debug))] @@ -117,35 +112,3 @@ pub async fn git_get_global_config( let result = app::App::git_get_global_config(key)?; Ok(result) } - -#[tauri::command(async)] -#[instrument(skip(handle), err(Debug))] -pub async fn project_flush_and_push(handle: tauri::AppHandle, id: ProjectId) -> Result<(), Error> { - let users = handle.state::().inner().clone(); - let projects = handle.state::().inner().clone(); - let local_data_dir = handle - .path_resolver() - .app_data_dir() - .context("failed to get app data dir")?; - - let project = projects.get(&id).context("failed to get project")?; - let user = users.get_user()?; - let project_repository = - project_repository::Repository::open(&project).map_err(Error::from_error_with_context)?; - let gb_repo = - gb_repository::Repository::open(&local_data_dir, &project_repository, user.as_ref()) - .context("failed to open repository")?; - - if let Some(current_session) = gb_repo - .get_current_session() - .context("failed to get current session")? - { - let watcher = handle.state::(); - watcher - .post(gitbutler_watcher::Action::Flush(id, current_session)) - .await - .context("failed to post flush event")?; - } - - Ok(()) -} diff --git a/crates/gitbutler-tauri/src/main.rs b/crates/gitbutler-tauri/src/main.rs index 408241d49..b126e91ea 100644 --- a/crates/gitbutler-tauri/src/main.rs +++ b/crates/gitbutler-tauri/src/main.rs @@ -177,7 +177,6 @@ fn main() { commands::mark_resolved, commands::git_set_global_config, commands::git_get_global_config, - commands::project_flush_and_push, commands::git_test_push, commands::git_test_fetch, commands::git_index_size,