Skip to content

Commit

Permalink
Fixed index errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecao committed Feb 1, 2025
1 parent f3e733d commit 3e9cb66
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ export function SessionsWeekly({ websiteId }: { websiteId: string }) {
<div className={styles.header}>
{format(getDayOfWeekAsDate(index), 'EEE', { locale: dateLocale })}
</div>
{day?.map((hour: number) => {
{day?.map((hour: number, n) => {
const pct = hour / max;
return (
<div key={hour} className={classNames(styles.cell)}>
<div key={`${index}_${n}_${hour}`} className={classNames(styles.cell)}>
{hour > 0 && (
<TooltipPopup
label={`${formatMessage(labels.visitors)}: ${hour}`}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Loading, Icon, StatusLight } from 'react-basics';
import Icons from 'components/icons';
import { useSessionActivity, useTimezone } from 'components/hooks';
import styles from './SessionActivity.module.css';
import { Fragment } from 'react';

export function SessionActivity({
websiteId,
Expand Down Expand Up @@ -31,7 +32,7 @@ export function SessionActivity({
lastDay = createdAt;

return (
<>
<Fragment key={eventId}>
{showHeader && (
<div className={styles.header}>{formatTimezoneDate(createdAt, 'EEEE, PPP')}</div>
)}
Expand All @@ -44,7 +45,7 @@ export function SessionActivity({
<Icon>{eventName ? <Icons.Bolt /> : <Icons.Eye />}</Icon>
<div>{eventName || urlPath}</div>
</div>
</>
</Fragment>
);
})}
</div>
Expand Down

0 comments on commit 3e9cb66

Please sign in to comment.