mirror of
https://git.vectorsigma.ru/public/tubearchivist.git
synced 2026-08-04 23:49:38 +00:00
fix custom playlist sortorder handling
This commit is contained in:
@@ -288,31 +288,33 @@ const Playlist = () => {
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
<div className="toggle">
|
||||
<span>Switch sort order:</span>
|
||||
<div className="toggleBox">
|
||||
<input
|
||||
id="playlist_sort_order"
|
||||
type="checkbox"
|
||||
checked={playlist.playlist_sort_order === 'bottom'}
|
||||
onChange={async () => {
|
||||
const newSortOrder =
|
||||
playlist.playlist_sort_order === 'top' ? 'bottom' : 'top';
|
||||
await updatePlaylistSortOrder(playlist.playlist_id, newSortOrder);
|
||||
setRefresh(true);
|
||||
}}
|
||||
/>
|
||||
{playlist.playlist_sort_order === 'bottom' ? (
|
||||
<label htmlFor="" className="onbtn">
|
||||
On
|
||||
</label>
|
||||
) : (
|
||||
<label htmlFor="" className="ofbtn">
|
||||
Off
|
||||
</label>
|
||||
)}
|
||||
{playlist.playlist_type !== 'custom' && (
|
||||
<div className="toggle">
|
||||
<span>Switch sort order:</span>
|
||||
<div className="toggleBox">
|
||||
<input
|
||||
id="playlist_sort_order"
|
||||
type="checkbox"
|
||||
checked={playlist.playlist_sort_order === 'bottom'}
|
||||
onChange={async () => {
|
||||
const newSortOrder =
|
||||
playlist.playlist_sort_order === 'top' ? 'bottom' : 'top';
|
||||
await updatePlaylistSortOrder(playlist.playlist_id, newSortOrder);
|
||||
setRefresh(true);
|
||||
}}
|
||||
/>
|
||||
{playlist.playlist_sort_order === 'bottom' ? (
|
||||
<label htmlFor="" className="onbtn">
|
||||
On
|
||||
</label>
|
||||
) : (
|
||||
<label htmlFor="" className="ofbtn">
|
||||
Off
|
||||
</label>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user