mirror of
https://github.com/Physton/sd-webui-prompt-all-in-one.git
synced 2026-05-01 11:41:46 +00:00
#264 Reverse the order of the favorite list.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user