fix(editor): appointment bucket-skip detects {id:null} shells too
The calendar day-popup invokes openModal with `{id: null, title, body}`
rather than a bare `null`, so `!card` was false and the #termin-body
exemption never fired — new appointments still inherited the active
bucket. Key the "is new" check on `card?.id` instead so both entry
shapes are treated the same.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
b08bdbaeb2
commit
c2485b1307
1 file changed
+4
-1
@@ -231,7 +231,10 @@ export function openModal(card = null) {
|
|||||||
// bucket — they belong to a calendar, not a kanban column. For
|
// bucket — they belong to a calendar, not a kanban column. For
|
||||||
// every other new card, inherit the active real bucket if we're
|
// every other new card, inherit the active real bucket if we're
|
||||||
// in one so the user doesn't have to re-pick it.
|
// in one so the user doesn't have to re-pick it.
|
||||||
const isNewAppointment = !card && /#(termin|geburtstag)\b/.test(body.value);
|
// `card` can be `null` (add-button new) or a shell `{id: null, ...}`
|
||||||
|
// from the calendar day-popup — both count as "new", so key on
|
||||||
|
// card?.id not the card ref itself.
|
||||||
|
const isNewAppointment = !card?.id && /#(termin|geburtstag)\b/.test(body.value);
|
||||||
inpBucket.value = card?.bucket_id ? card.bucket_id
|
inpBucket.value = card?.bucket_id ? card.bucket_id
|
||||||
: (isNewAppointment ? ''
|
: (isNewAppointment ? ''
|
||||||
: (!virtualBuckets.includes(state.activeBucket) ? state.activeBucket : ''));
|
: (!virtualBuckets.includes(state.activeBucket) ? state.activeBucket : ''));
|
||||||
|
|||||||
Reference in new issue
Block a user