Skip to content

Commit

Permalink
feat: hide apps without icon
Browse files Browse the repository at this point in the history
暂时隐藏没有图标的应用

Log:
  • Loading branch information
myml authored and black-desk committed Dec 20, 2023
1 parent 283b80d commit c141903
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/components/Main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,22 @@ export default defineComponent({
size: pageSize,
},
})
.then(function (response) {
appList.value = response.data.data.list;
.then(async (response) => {
total.value = response.data.data.total;
const list = response.data.data.list.filter(app => !app.icon.endsWith("application-x-executable.svg"))
// 因为有部分应用没有图标不利于演示,暂时隐藏
if (list.length < 24) {
const randomPage = Math.floor(Math.random() * 20) + 20
const resp = await service
.get<AppsResponse>(`/api/v0/web-store/apps`, {
params: {
page: randomPage,
size: pageSize,
},
})
list.push(...resp.data.data.list.filter(app => !app.icon.endsWith("application-x-executable.svg")))
}
appList.value = list.slice(0, size);
dataLoadingFlag.value = false;
})
.catch(function (error) {
Expand Down

0 comments on commit c141903

Please sign in to comment.