fix: set selected visibility option to settings value on options open

This commit is contained in:
June 2025-07-15 19:35:48 +02:00
parent bcb61b51ac
commit a477d3b95a
No known key found for this signature in database

View File

@ -30,6 +30,17 @@ export default class PrefsBoxOrderItemOptionsDialog extends Adw.Dialog {
this.item = item;
// Load the settings.
this.#settings = ExtensionPreferences.lookupByURL(import.meta.url)!.getSettings();
// Set the selected visibility row choice to the settings value.
const itemsToHide = new Set(this.#settings.get_strv("hide"));
const itemsToShow = new Set(this.#settings.get_strv("show"));
if (itemsToHide.has(this.item)) {
this._visibility_row.set_selected(1);
} else if (itemsToShow.has(this.item)) {
this._visibility_row.set_selected(2);
} else {
this._visibility_row.set_selected(0);
}
}
onVisibilityRowSelectionChanged(): void {