DeutscheModelUnitedNations / munify-delegator

DELEGATOR registration app, part of MUN-Product Suite MUNify
GNU Affero General Public License v3.0
4 stars 3 forks source link

If Gender is changed defult pronouns are staying the same #49

Open maximilianilzhoefer opened 2 weeks ago

maximilianilzhoefer commented 2 weeks ago

When I create my user and select one gender default pronouns are set. If I change my gender while not touching the pronouns the pronouns do not change to the new default for the used gender.

https://github.com/DeutscheModelUnitedNations/munify-delegator/blob/3d0e3adf637e6b33254966cbc304cf5695b948fa/src/routes/(authenticated)/my-account/%2Bpage.svelte#L68

TadeSF commented 2 weeks ago

Yes, that is by design, because otherwise you would override custom pronouns.

maximilianilzhoefer commented 2 weeks ago

Okay, but are manual changes not tracked with pronounsHaveChanged? If the if clause is changed to if (!pronounsHaveChanged) should that not yield the desired effect?

TadeSF commented 2 weeks ago

Yes, but the pronounsHaveChanged variable is applied globally and is set with the $effect clause that is triggered whenever the default empty string is replaced. That means the flag is also set true a) when the user selects male/female for the first time and the default is set and b) when data is initially loaded from the servers response after mounting. If that would be not the case, it would be possible to override custom pronouns by selecting a different gender fresh after reloading