Skip to content

Commit

Permalink
correct mistakes
Browse files Browse the repository at this point in the history
  • Loading branch information
MaHaWo committed Aug 31, 2024
1 parent 0b102d1 commit bf55e3b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/lib/components/ChildrenRegistration.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
const verified = await verifyInput();
if (verified) {
const childID = generateChildID(childData.name);
await addChildData(userID, childID, childData);
await addChildObservation(userID, childID, {
await children.addChildData(userID, childID, childData);
await children.addChildObservation(userID, childID, {
user: userID,
id: childID,
summary: await createDummySummary(),
Expand Down
9 changes: 0 additions & 9 deletions src/lib/stores/basicStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,6 @@ class BasicStore<T extends Record<string, unknown>> {
}
this.store.set(data as T);
}

/**
*
*/
public async clear(): Promise<void> {
if (browser) {
localStorage.clear();
}
}
}

export { BasicStore };
2 changes: 1 addition & 1 deletion src/lib/stores/childrenStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class ChildrenStore extends BasicStore<ChildrenList> {
*/
constructor(name: string = 'children') {
if (ChildrenStore._instance) {
return ChildrenStore._instance;
throw new Error("Singleton classes can't be instantiated more than once.");

Check failure on line 61 in src/lib/stores/childrenStore.ts

View workflow job for this annotation

GitHub Actions / unit-tests

src/lib/stores/childrenStore.test.ts

Error: Singleton classes can't be instantiated more than once. ❯ new ChildrenStore src/lib/stores/childrenStore.ts:61:10 ❯ src/lib/stores/childrenStore.test.ts:49:19
} else {
super(name, 'children');
ChildrenStore._instance = this;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/stores/contentStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ContentStore extends BasicStore<ContentList> {

constructor(name: string = 'content') {
if (ContentStore._instance) {
return ContentStore._instance;
throw new Error("Singleton classes can't be instantiated more than once.");
} else {
super(name, 'content');
ContentStore._instance = this;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/stores/userStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class UserStore extends BasicStore<UserList> {

constructor(name: string = 'users') {
if (UserStore._instance) {
return UserStore._instance;
throw new Error("Singleton classes can't be instantiated more than once.");
} else {
super(name, 'users');
UserStore._instance = this;
Expand Down

0 comments on commit bf55e3b

Please sign in to comment.