@@ -4,7 +4,7 @@ import { persisted } from '$lib/persisted/persisted';
4
4
import * as toasts from '$lib/utils/toasts' ;
5
5
import { open } from '@tauri-apps/api/dialog' ;
6
6
import { plainToInstance } from 'class-transformer' ;
7
- import { derived , get , writable } from 'svelte/store' ;
7
+ import { get , writable } from 'svelte/store' ;
8
8
import type { HttpClient } from './httpClient' ;
9
9
import { goto } from '$app/navigation' ;
10
10
@@ -44,7 +44,7 @@ export type CloudProject = {
44
44
45
45
export class ProjectService {
46
46
private persistedId = persisted < string | undefined > ( undefined , 'lastProject' ) ;
47
- private _projects = writable < Project [ ] > ( undefined , ( set ) => {
47
+ readonly projects = writable < Project [ ] > ( [ ] , ( set ) => {
48
48
this . loadAll ( )
49
49
. then ( ( projects ) => {
50
50
this . error . set ( undefined ) ;
@@ -55,7 +55,6 @@ export class ProjectService {
55
55
showError ( 'Failed to load projects' , err ) ;
56
56
} ) ;
57
57
} ) ;
58
- readonly projects = derived ( this . _projects , ( value ) => value ) ; // public & readonly
59
58
readonly error = writable ( ) ;
60
59
61
60
constructor (
@@ -68,7 +67,7 @@ export class ProjectService {
68
67
}
69
68
70
69
async reload ( ) : Promise < void > {
71
- this . _projects . set ( await this . loadAll ( ) ) ;
70
+ this . projects . set ( await this . loadAll ( ) ) ;
72
71
}
73
72
74
73
async getProject ( projectId : string ) {
0 commit comments