Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create UserConfig Collection after User Signup #271

Merged
merged 3 commits into from
Sep 17, 2024

Conversation

KOrtizLedezma
Copy link
Contributor

Description

This PR adds the functionality to automatically create a UserConfig document in Firebase Firestore after a user signs up in the app.

Key Changes:

  • A new method createUserConfig has been added to the AuthStore.ts class.
  • After user signup, createUserConfig is called, which creates a UserConfig document in Firestore for the newly registered user.
  • The UserConfig collection is initialized with the following default fields:
    • darkMode: false (indicating that dark mode is disabled by default)
    • notificationsEnabled: false (indicating that notifications are disabled by default)
    • language: 'English' (default language setting)

This ensures that each new user has a personalized configuration stored, which can be updated later according to user preferences.

@h1divp
Copy link
Collaborator

h1divp commented Sep 14, 2024

my bad I shouldn't have tried to sync

@h1divp
Copy link
Collaborator

h1divp commented Sep 14, 2024

Fixed the unnecessary rebase I made.

@h1divp
Copy link
Collaborator

h1divp commented Sep 14, 2024

Did some testing and it works after a configuration update. Made some slight changes to better match the UserConfigs collection described here. No need to worry about moderation settings though.

Copy link
Collaborator

@h1divp h1divp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the future, we will probably want to put attributes used in the default UserConfig document into a type, that way when we reference this kind of document elsewhere, and say copy it into user settings in the settings context, it will be harder to forget any modified attributes. After this merge we are good to start connecting the client and server for user settings storage 👍

@h1divp h1divp merged commit e1a4cdf into ufosc:main Sep 17, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants