mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-08-14 23:57:27 +00:00
Add random sort
This commit is contained in:
parent
0af7b8ffb1
commit
749be5350e
1 changed files with 3 additions and 0 deletions
|
@ -13,6 +13,7 @@ const options = {
|
|||
least_recent: "ascending",
|
||||
channel_name_asc: "channel_ascending",
|
||||
channel_name_desc: "channel_descending",
|
||||
random: "random",
|
||||
};
|
||||
|
||||
const selectedSort = ref("descending");
|
||||
|
@ -37,6 +38,8 @@ watch(selectedSort, value => {
|
|||
case "channel_descending":
|
||||
emit("apply", (a, b) => b.uploaderName.localeCompare(a.uploaderName));
|
||||
break;
|
||||
case "random":
|
||||
emit("apply", (a, b) => Math.random() - 0.5);
|
||||
default:
|
||||
console.error("Unexpected sort value");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue