Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

[C-1062] Update loading states for favorites and collection page tables #2045

Merged
merged 1 commit into from
Oct 3, 2022
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,12 @@ export const TestTracksTable = ({
(cellInfo) => {
const track = cellInfo.row.original
const deleted = track.is_delete || track.user?.is_deactivated
if (deleted) {
const isOwner = track.owner_id === userId
if (deleted || isOwner) {
return <div className={styles.placeholderButton} />
}

const isOwner = track.owner_id === userId
return isOwner ? null : (
return (
<Tooltip
text={track.has_current_user_reposted ? 'Unrepost' : 'Repost'}
mount='page'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ const CollectionPage = ({
columns={tracksTableColumns}
wrapperClassName={styles.tracksTableWrapper}
key={playlistName}
loading={isNftPlaylist ? tracksLoading : collectionLoading}
loading={isNftPlaylist ? collectionLoading : tracksLoading}
userId={userId}
playing={playing}
playingIndex={playingIndex}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,11 @@ const SavedPage = ({
: [[], -1]
const { isLoading: isLoadingAlbums, setDidLoad: setDidLoadAlbums } =
useOrderedLoad(account ? account.albums.length : 0)
const isEmpty = entries.length === 0
const tracksLoading = status === Status.LOADING && isEmpty
const isEmpty =
entries.length === 0 ||
!entries.some((entry: SavedPageTrack) => Boolean(entry.track_id))
const tracksLoading =
(status === Status.IDLE || status === Status.LOADING) && isEmpty
const queuedAndPlaying = playing && isQueued

// Setup play button
Expand Down