-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added toggles to user object and tracked state
- Loading branch information
Showing
4 changed files
with
37 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,9 @@ interface User { | |
following: number; | ||
email: string; | ||
dummyPassword: string; | ||
postActivity: boolean; | ||
friendPosts: boolean; | ||
taggedPosts: boolean; | ||
setAttribute: (attribute: string, value: any) => void; // Updated to `any` to allow more flexible types | ||
resetAttributes: () => void; | ||
setAllUndefined: () => void; | ||
|
@@ -34,6 +37,9 @@ const initialState: Omit< | |
following: 21, | ||
email: "[email protected]", | ||
dummyPassword: "password", | ||
postActivity: true, | ||
friendPosts: true, | ||
taggedPosts: true, | ||
}; | ||
|
||
export const useUser = create<User>()((set) => ({ | ||
|
@@ -60,5 +66,8 @@ export const useUser = create<User>()((set) => ({ | |
following: undefined, | ||
email: undefined, | ||
dummyPassword: undefined, | ||
postActivity: undefined, | ||
friendPosts: undefined, | ||
taggedPosts: undefined, | ||
})), | ||
})); |