Problems storing data in User Settings

Hi everyone,
I’m trying to make a small adjustment to the behavior of the Full Width toggle so that its value is stored in the __UserSettings Table instead of in Local Storage.
However, my code is not working. Either the data is not stored correctly or is not retrieved correctly. For test purposes, the data is associated with the User table.

toggle_full_width() {
	let user_settings = frappe.get_user_settings('User', 'UI') || {};
	let fullwidth = user_settings.full_width || false;
	frappe.model.user_settings.save('User', 'UI', {
		full_width: !fullwidth
	});		
	frappe.ui.toolbar.set_fullwidth_if_enabled();
},
set_fullwidth_if_enabled() {
	let user_settings = frappe.get_user_settings('User', 'UI') || {};
	let fullwidth = user_settings.full_width || false;
	$(document.body).toggleClass('full-width', fullwidth);
},

It’s not that important because I do the customization mainly to practice programming, but I would still be happy if it worked.

Thanks for any help!