Open ShreyanKhanna opened 2 years ago
Right now, all of these are stored in localstorage, but the question is: What do you do if someone changes their preferences, and then signs into an account that already has preferences? Which ones do we keep?
you would put it as the one in the account also don't let them change it without an account
as it would be in the account setting which you can't access without an account so they wouldn't be able to change it
Ok So I will save their preferences when not logged in, but those will always be overridden by account level settings
I might as well make a schema
users
collection:
ID | preferences: map |
---|---|
uid1 | see below |
Preferences schema:
{
"hue": 0-360, // or also theme in the future?
"study_modes": {
"flashcards": {
"answer_with": 0-1,
"starred": true/false
},
"learn": {
"answer_with": 0-1,
"starred": true/false
},
"test": {
"answer_with": 0-1,
"starred": true/false,
"types": 1001 // bitmask
},
"match": {
"answer_with": 0-1,
"starred": true/false
}
},
"starred": {
"set_id": [1, 3, 5] // TODO: Rn this is a list of numbers. It would be better to use a bitmask
}
}
All CRUD operations can only be done if document ID matches user ID
Right makes sense
Discussed in https://github.com/orgs/For-0/discussions/190