#264 Reverse the order of the favorite list.

This commit is contained in:
Physton
2023-11-07 23:10:07 +08:00
parent 2503070b8c
commit 7c5160a9be

View File

@@ -137,7 +137,7 @@ export default {
this.gradioAPI.getFavorites(favoriteKey).then(res => {
if(res && res.length > 0){
// 倒序
// res.reverse()
res.reverse()
res.forEach(item => {
item.is_favorite = true
})
@@ -276,7 +276,8 @@ export default {
if (!group) return
let favorite = group.list[index]
if (index === 0) return
this.gradioAPI.moveUpFavorite(this.favoriteKey, favorite.id).then(res => {
this.gradioAPI.moveDownFavorite(this.favoriteKey, favorite.id).then(res => {
// this.gradioAPI.moveUpFavorite(this.favoriteKey, favorite.id).then(res => {
if (res) {
group.list.splice(index, 1)
group.list.splice(index - 1, 0, favorite)
@@ -289,7 +290,8 @@ export default {
if (!group) return
let favorite = group.list[index]
if (index === group.list.length - 1) return
this.gradioAPI.moveDownFavorite(this.favoriteKey, favorite.id).then(res => {
this.gradioAPI.moveUpFavorite(this.favoriteKey, favorite.id).then(res => {
// this.gradioAPI.moveDownFavorite(this.favoriteKey, favorite.id).then(res => {
if (res) {
group.list.splice(index, 1)
group.list.splice(index + 1, 0, favorite)