Update acrding review changes
This commit is contained in:
parent
ede7ca0150
commit
207f95fcda
1 changed files with 6 additions and 8 deletions
|
@ -58,15 +58,13 @@ const Kanban = (props: Props) => {
|
|||
const currentView = useAppSelector(getCurrentView)
|
||||
const cardTemplates: Card[] = useAppSelector(getCurrentBoardTemplates)
|
||||
const {board, activeView, cards, groupByProperty, visibleGroups, hiddenGroups, hiddenCardsCount} = props
|
||||
const [defaultTemplateID, setDefaultTemplateID] = useState('')
|
||||
const [defaultTemplateID, setDefaultTemplateID] = useState<string>()
|
||||
|
||||
useEffect(() => {
|
||||
if(currentView.fields && currentView.fields.defaultTemplateId) {
|
||||
cardTemplates.forEach((cardTemplate) => {
|
||||
if(cardTemplate.id === currentView.fields.defaultTemplateId) {
|
||||
setDefaultTemplateID(currentView.fields.defaultTemplateId)
|
||||
}
|
||||
})
|
||||
if(currentView && currentView.fields && currentView.fields.defaultTemplateId) {
|
||||
if(cardTemplates.find(ct => ct.id === currentView.fields.defaultTemplateId)) {
|
||||
setDefaultTemplateID(currentView.fields.defaultTemplateId)
|
||||
}
|
||||
}
|
||||
}, [currentView])
|
||||
|
||||
|
@ -310,7 +308,7 @@ const Kanban = (props: Props) => {
|
|||
<BoardPermissionGate permissions={[Permission.ManageBoardCards]}>
|
||||
<Button
|
||||
onClick={() => {
|
||||
if(defaultTemplateID !== '') {
|
||||
if(defaultTemplateID) {
|
||||
props.addCardFromTemplate(defaultTemplateID, group.option.id)
|
||||
} else {
|
||||
props.addCard(group.option.id, true)
|
||||
|
|
Loading…
Reference in a new issue