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

Commit

Permalink
Update loading states for favorites and collection page tables (#2045)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyle-Shanks authored Oct 3, 2022
1 parent ab3190d commit 2a06bfd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
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

0 comments on commit 2a06bfd

Please sign in to comment.