Skip to content

Commit

Permalink
fix: Deleting a project causes multiple UI issues (#2749)
Browse files Browse the repository at this point in the history
  • Loading branch information
novakzaballa authored Sep 7, 2023
1 parent 8566fe0 commit 8cd144b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion frontend/common/stores/organisation-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,20 @@ const controller = {
},

deleteProject: (id) => {
const idInt = parseInt(id)
store.saving()
if (store.model) {
store.model.projects = _.filter(store.model.projects, (p) => p.id !== id)
store.model.projects = _.filter(
store.model.projects,
(p) => p.id !== idInt,
)
store.model.keyedProjects = _.keyBy(store.model.projects, 'id')
}
API.trackEvent(Constants.events.REMOVE_PROJECT)
data.delete(`${Project.api}projects/${id}/`).then(() => {
AsyncStorage.removeItem('lastEnv')
store.trigger('removed')
store.saved()
})
},
deleteUser: (id) => {
Expand Down

3 comments on commit 8cd144b

@vercel
Copy link

@vercel vercel bot commented on 8cd144b Sep 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

docs – ./docs

docs-flagsmith.vercel.app
docs-git-main-flagsmith.vercel.app
docs.flagsmith.com
docs.bullet-train.io

@vercel
Copy link

@vercel vercel bot commented on 8cd144b Sep 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 8cd144b Sep 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.