Settings was incorrectly using on:change on a select to trigger locale updates and settings saves.
This change moves the logic for applying a new locale and saving it to the afterUpdate part of the component lifecycle. Since the select is utilizing bind:value to update the currently selected code, we can key off currentLanguage which updates based on that bound value. When the component updates, we can save currentLanguage instead.
Settings was incorrectly using
on:change
on aselect
to trigger locale updates and settings saves.This change moves the logic for applying a new locale and saving it to the
afterUpdate
part of the component lifecycle. Since theselect
is utilizingbind:value
to update the currently selected code, we can key offcurrentLanguage
which updates based on that bound value. When the component updates, we can savecurrentLanguage
instead.