Bug 1921658 - Set CalendarBaseView.weekStartOffset after the default preferences. r=aleca

In the earliest case, `ensureInitialized` runs as tabs are restored, so always after
`setLocaleDefaultPreferences`. Unlike `connectedCallback` which runs as soon as the custom element
is defined and attached to the DOM.

It needs to happen after `setLocaleDefaultPreferences` to get the correct value if the correct
value is not 0.

Differential Revision: https://phabricator.services.mozilla.com/D226086

--HG--
extra : amend_source : 493e0709b2f62a375c56ab3e31a69932401bd1c1
This commit is contained in:
Geoff Lankow 2024-10-18 10:26:57 +01:00
Родитель 13d2c0bd05
Коммит 282f08f30a
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -87,7 +87,6 @@
});
this.mSelectedItems = [];
this.weekStartOffset = Services.prefs.getIntPref("calendar.week.start");
}
ensureInitialized() {
@ -96,6 +95,7 @@
}
this.#isInitialized = true;
this.weekStartOffset = Services.prefs.getIntPref("calendar.week.start");
this.calICalendarView = this.getCustomInterfaceCallback(Ci.calICalendarView);
this.addEventListener("move", event => {