mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-09-19 16:17:37 +03:00
Move syncToCloud
out of httpClient.ts
This commit is contained in:
parent
b7ca1ad2c4
commit
7aa30724e7
@ -1,4 +1,3 @@
|
||||
import { invoke } from './ipc';
|
||||
import { PUBLIC_API_BASE_URL } from '$env/static/public';
|
||||
|
||||
export const API_URL = new URL('/api/', PUBLIC_API_BASE_URL);
|
||||
@ -103,11 +102,3 @@ async function parseResponseJSON(response: Response) {
|
||||
return await response.json();
|
||||
}
|
||||
}
|
||||
|
||||
export async function syncToCloud(projectId: string | undefined) {
|
||||
try {
|
||||
if (projectId) await invoke<void>('project_flush_and_push', { id: projectId });
|
||||
} catch (err: any) {
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
|
9
app/src/lib/backend/sync.ts
Normal file
9
app/src/lib/backend/sync.ts
Normal file
@ -0,0 +1,9 @@
|
||||
import { invoke } from './ipc';
|
||||
|
||||
export async function syncToCloud(projectId: string | undefined) {
|
||||
try {
|
||||
if (projectId) await invoke<void>('project_flush_and_push', { id: projectId });
|
||||
} catch (err: any) {
|
||||
console.error(err);
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { syncToCloud } from '$lib/backend/httpClient';
|
||||
import { Project } from '$lib/backend/projects';
|
||||
import { syncToCloud } from '$lib/backend/sync';
|
||||
import Tag from '$lib/components/Tag.svelte';
|
||||
import TimeAgo from '$lib/components/TimeAgo.svelte';
|
||||
import { GitHubService } from '$lib/github/service';
|
||||
|
@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { syncToCloud } from '$lib/backend/httpClient';
|
||||
import { Project } from '$lib/backend/projects';
|
||||
import { syncToCloud } from '$lib/backend/sync';
|
||||
import { BranchService } from '$lib/branches/service';
|
||||
import Navigation from '$lib/components/Navigation.svelte';
|
||||
import NoBaseBranch from '$lib/components/NoBaseBranch.svelte';
|
||||
|
Loading…
Reference in New Issue
Block a user