cal.diy icon indicating copy to clipboard operation
cal.diy copied to clipboard

Showing blank notification box and negative numbers for recurring events

Open ericrommel opened this issue 3 years ago • 5 comments

Found a bug? Please fill out the sections below. 👍

Issue Summary

When there are 5 or less than that, it's showing 0 or the difference between 5 and the recurring numbers. Also, an empty/blank notification box is shown.

Steps to Reproduce

  1. Set a recurring event type with 3 events recurring (issue is between 5 and 1)
  2. Copy the event link and open it in another tab
  3. Set a day and time
  4. Check the list of events. You can see a "-2" together with "+ more"
  5. Mouse over that list to see the blank box notification

Tested on Vercel preview (https://cal-5luk9i0hk-cal.vercel.app/event-types)

Technical details

  • Tested on Chrome v114.0.5735.134
  • Windows 11 PRO

image

image

image

image

image

ericrommel avatar Jun 17 '23 19:06 ericrommel

@ericrommel could you assign this to me? Thanks

kemilbeltre avatar Jun 18 '23 11:06 kemilbeltre

Hey, @ericrommel checking the code above, it seems to be not possible to reproduce this error:

{!rescheduleUid && eventType?.recurringEvent?.freq && recurringStrings.length > 5 && (
                        <div className="flex">
                          <Tooltip
                            content={recurringStrings.slice(5).map((timeFormatted, key) => (
                              <p key={key}>{timeFormatted}</p>
                            ))}>
                            <p className=" text-sm">
                              + {t("plus_more", { count: recurringStrings.length })}
                            </p>
                          </Tooltip>
                        </div>
                      )}

Do you think I'm missing something?

kemilbeltre avatar Jun 18 '23 12:06 kemilbeltre

In order to avoid a negative length we can use the + to convert a string representation of a number to a number.

kemilbeltre avatar Jun 18 '23 12:06 kemilbeltre

Hey @kemilbeltre, where are you testing that? Are using the Vercel preview?

ericrommel avatar Jun 19 '23 12:06 ericrommel

Hey @kemilbeltre, where are you testing that? Are using the Vercel preview?

Hi @ericrommel I'm just running the app locally. I don't have a user to access Vercel Preview. :)

kemilbeltre avatar Jun 19 '23 14:06 kemilbeltre