Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue-1940/duplicated-events-in-calendar #1945

Merged
merged 3 commits into from
May 24, 2024

Conversation

kaulfield23
Copy link
Contributor

@kaulfield23 kaulfield23 commented May 10, 2024

Description

This PR fixes a bug where changing dates of an event leaves duplicates in calendar

Screenshots

Calendar.Mozilla.Firefox.2024-05-10.10-37-19.mp4

image

Changes

  • Adds more if statements

Notes to reviewer

Related issues

Resolves #1940

@kaulfield23 kaulfield23 marked this pull request as draft May 10, 2024 08:39
@kaulfield23 kaulfield23 changed the title add more conditions to fix the duplicated events issue-1940/duplicated-events-in-calendar May 10, 2024
@kaulfield23 kaulfield23 marked this pull request as ready for review May 10, 2024 09:15
@awarn
Copy link
Collaborator

awarn commented May 12, 2024

This seems to work for all I can tell!
Using the substring of the date as a key for the events does seem awkward (but presumably safe if we guarantee there is a always a start date value), though that is really a bigger question about "eventsByDate" than for this particular issue and pull request.

Copy link
Contributor

@ziggabyte ziggabyte left a comment

Choose a reason for hiding this comment

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

Playing with this code works well!

In a conversation earlier today me and @richardolsson talked about the need for refactoring the addEventToState function. Reading these updates to the code I feel like it's still not "there" yet, but at the moment I can't really put my finger on what concrete feedback would make the code better 😅

So I have made comments on some more "cosmetic" things that I feel could make the code clearer, and maybe @richardolsson can add in if he feels that there are needs for other updates?

src/features/events/store.ts Outdated Show resolved Hide resolved
src/features/events/store.ts Outdated Show resolved Hide resolved
src/features/events/store.ts Outdated Show resolved Hide resolved
src/features/events/store.ts Outdated Show resolved Hide resolved
@kaulfield23
Copy link
Contributor Author

Hmm merge conflicts! Will fix it today

Copy link
Member

@richardolsson richardolsson left a comment

Choose a reason for hiding this comment

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

I have looked at the code and the preview build and it's all looking good. Nice work!

@kaulfield23 kaulfield23 merged commit b06d572 into main May 24, 2024
5 checks passed
@kaulfield23 kaulfield23 deleted the issue-1940/event-duplicated-in-calendar branch May 24, 2024 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calendar: Changing dates of an event leaves duplicates in calendar
4 participants