Skip to content

Commit c84139b

Browse files
committedFeb 22, 2024
fix(import): only stream count when processing or processed (always show for spotify)
1 parent f24243d commit c84139b

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed
 

‎src/components/Import/ImportItem.tsx

+12-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Fragment, type FC } from 'react';
2+
import { Platform } from '@/utils/statsfm';
23
import type { UserImport } from '@/utils/statsfm';
34
import clsx from 'clsx';
45
import {
@@ -13,7 +14,7 @@ import { Button } from '../Button';
1314

1415
export const ImportItem: FC<
1516
UserImport & { deleteItem: (id: number) => Promise<void> }
16-
> = ({ name, status, count, createdAt, id, deleteItem }) => {
17+
> = ({ name, status, count, createdAt, id, deleteItem, service }) => {
1718
return (
1819
<li className="flex items-center justify-between gap-x-6 py-5">
1920
<div className="min-w-0">
@@ -41,10 +42,16 @@ export const ImportItem: FC<
4142
timeStyle: 'short',
4243
})}
4344
</p>
44-
<svg viewBox="0 0 2 2" className="h-0.5 w-0.5 fill-current">
45-
<circle cx={1} cy={1} r={1} />
46-
</svg>
47-
<p className="truncate">{count.toLocaleString()} streams</p>
45+
46+
{(service === Platform.SPOTIFY ||
47+
(service === Platform.APPLEMUSIC && [1, 2].includes(status))) && (
48+
<>
49+
<svg viewBox="0 0 2 2" className="h-0.5 w-0.5 fill-current">
50+
<circle cx={1} cy={1} r={1} />
51+
</svg>
52+
<p className="truncate">{count.toLocaleString()} streams</p>
53+
</>
54+
)}
4855
</div>
4956
</div>
5057
<div className="flex flex-none items-center gap-x-4">

0 commit comments

Comments
 (0)