Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/components/forms/speaker-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ class SpeakerForm extends React.Component {

if (ev.target.type === "memberinput") {
entity.email = "";
if (value && mustReplaceSpeakerFieldsWithMemberInfo()) {
if (
(value && mustReplaceSpeakerFieldsWithMemberInfo()) ||
(value && !mustReplaceSpeakerFieldsWithMemberInfo() && entity.id === 0)
) {
Comment on lines +85 to +88
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

The conditional logic can be simplified. The current condition checks 'value' twice and calls 'mustReplaceSpeakerFieldsWithMemberInfo()' twice. This can be refactored to: 'value && (mustReplaceSpeakerFieldsWithMemberInfo() || entity.id === 0)' which is more readable and efficient.

Suggested change
if (
(value && mustReplaceSpeakerFieldsWithMemberInfo()) ||
(value && !mustReplaceSpeakerFieldsWithMemberInfo() && entity.id === 0)
) {
if (value && (mustReplaceSpeakerFieldsWithMemberInfo() || entity.id === 0)) {

Copilot uses AI. Check for mistakes.
entity.affiliations = [...value.affiliations];
entity.first_name = !isEmptyString(value.first_name)
? value.first_name
Expand Down