diff --git a/front/src/Phaser/Game/UI/UIWebsiteManager.ts b/front/src/Phaser/Game/UI/UIWebsiteManager.ts index ce3bb0d6..a717138d 100644 --- a/front/src/Phaser/Game/UI/UIWebsiteManager.ts +++ b/front/src/Phaser/Game/UI/UIWebsiteManager.ts @@ -59,6 +59,8 @@ class UIWebsiteManager { website.margin.right = websiteEvent.margin.right; } } + + uiWebsitesStore.update(website); }); } diff --git a/front/src/Stores/UIWebsiteStore.ts b/front/src/Stores/UIWebsiteStore.ts index 37c17156..92fccd11 100644 --- a/front/src/Stores/UIWebsiteStore.ts +++ b/front/src/Stores/UIWebsiteStore.ts @@ -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)); },