Fix uiWebsite updating

This commit is contained in:
Alexis Faizeau 2022-05-06 15:27:55 +02:00 committed by David Négrier
parent e710c441b1
commit fc7a7aa54d
2 changed files with 7 additions and 0 deletions

View File

@ -59,6 +59,8 @@ class UIWebsiteManager {
website.margin.right = websiteEvent.margin.right;
}
}
uiWebsitesStore.update(website);
});
}

View File

@ -11,6 +11,11 @@ function createUIWebsiteStore() {
add: (uiWebsite: UIWebsite) => {
update((currentArray) => [...currentArray, uiWebsite]);
},
update: (uiWebsite: UIWebsite) => {
update((currentArray) =>
currentArray.map((currentWebsite) => (currentWebsite.id === uiWebsite.id ? uiWebsite : currentWebsite))
);
},
remove: (uiWebsite: UIWebsite) => {
update((currentArray) => currentArray.filter((currentWebsite) => currentWebsite.id !== uiWebsite.id));
},