Skip to content

Commit

Permalink
Updated collection name, added more default attributes from documenta…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
h1divp committed Sep 14, 2024
1 parent 70b337f commit 352aa33
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion client/app/services/AuthStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,22 @@ export const AuthStore = new Store<AuthStoreInterface>({

const createUserConfig = async (userId: string) => {
try {
const docRef = doc(db, "UserConfig", userId);
const docRef = doc(db, "UserConfigs", userId);

await setDoc(docRef, {
// TODO: create a matching UserConfig type in the app/types folder.
// In documentation: make explicit that the key for UserConfig documents is the same as a uid from the user auth collection.
isConnected: false,
lastConnectionTime: "",
displayName: "",
userIcon: {
imageType: 0,
color: "#02efdb"
},
darkMode: false,
notificationsEnabled: false,
language: "English",

});
} catch (e){
console.error("Error creating UserConfig: ", e);
Expand Down

0 comments on commit 352aa33

Please sign in to comment.