Don't wait for things we don't care about
This commit is contained in:
parent
872446e524
commit
e0c4273acf
|
@ -48,24 +48,20 @@ export class RowActionStore extends BudiStore {
|
||||||
getName: x => x.name,
|
getName: x => x.name,
|
||||||
})
|
})
|
||||||
|
|
||||||
// Create the action and update state
|
// Create the action
|
||||||
const res = await API.rowActions.create({
|
const res = await API.rowActions.create({
|
||||||
name,
|
name,
|
||||||
tableId,
|
tableId,
|
||||||
})
|
})
|
||||||
this.update(state => ({
|
|
||||||
...state,
|
|
||||||
[tableId]: [...(state[tableId] || []), res],
|
|
||||||
}))
|
|
||||||
|
|
||||||
// If adding to a view, enable on this view
|
// Enable action on this view if adding via a view
|
||||||
if (viewId) {
|
if (viewId) {
|
||||||
await this.enableView(tableId, viewId, res.id)
|
await this.enableView(tableId, viewId, res.id)
|
||||||
|
} else {
|
||||||
|
await this.refreshRowActions(tableId)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Refresh automations so we have this new row action automation
|
automationStore.actions.fetch()
|
||||||
await automationStore.actions.fetch()
|
|
||||||
|
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,10 +89,8 @@ export class RowActionStore extends BudiStore {
|
||||||
rowActionId,
|
rowActionId,
|
||||||
name,
|
name,
|
||||||
})
|
})
|
||||||
await Promise.all([
|
await this.refreshRowActions(tableId)
|
||||||
this.refreshRowActions(tableId),
|
automationStore.actions.fetch()
|
||||||
automationStore.actions.fetch(),
|
|
||||||
])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
delete = async (tableId, rowActionId) => {
|
delete = async (tableId, rowActionId) => {
|
||||||
|
|
Loading…
Reference in New Issue