mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-23 17:43:47 +03:00
delete project from store on delete
This commit is contained in:
parent
cf08bb8a24
commit
5e20cdaeb5
@ -1,6 +1,6 @@
|
||||
import { invoke } from '$lib/ipc';
|
||||
import type { Project as ApiProject } from '$lib/api/cloud';
|
||||
import { asyncWritable, derived, type WritableLoadable } from '@square/svelte-store';
|
||||
import { asyncWritable, derived } from '@square/svelte-store';
|
||||
|
||||
export type Project = {
|
||||
id: string;
|
||||
@ -47,7 +47,8 @@ export const Projects = () => {
|
||||
store.update((projects) => projects.map((p) => (p.id === project.id ? project : p)));
|
||||
return project;
|
||||
}),
|
||||
delete: () => del({ id })
|
||||
delete: () =>
|
||||
del({ id }).then(() => store.update((projects) => projects.filter((p) => p.id !== id)))
|
||||
};
|
||||
},
|
||||
add: (params: { path: string }) =>
|
||||
|
Loading…
Reference in New Issue
Block a user