Skip to content

Commit b4e6209

Browse files
committed
feat(Apps): Installed should always be available in the catalog
1 parent 7c2a90b commit b4e6209

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

frontend/src/entities/Apps/model/stores.ts

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { ref, computed, reactive } from 'vue'
22
import { defineStore } from 'pinia'
33
import { Platform } from 'quasar'
4+
import type { AxiosError } from 'axios'
45
import { isProd, isDebug } from 'shared/config'
56
// import asyncSleep from 'simple-async-sleep'
67
import { FlipperModel } from 'entity/Flipper'
@@ -12,6 +13,7 @@ import { showNotif } from 'shared/lib/utils/useShowNotif'
1213
import { logger } from 'shared/lib/utils/useLog'
1314

1415
// import { instance } from 'boot/axios'
16+
import type { ApiErrorDetail } from 'shared/types/api'
1517
import { App, InstalledApp, AppsPostShortParams, ActionType } from './types'
1618
import { api } from '../api'
1719
const { fetchAppsVersions, fetchPostAppsShort /* , fetchAppFap */ } = api
@@ -140,6 +142,12 @@ export const useAppsStore = defineStore('apps', () => {
140142
actualApps = await fetchPostAppsShort({
141143
...params,
142144
applications: installed.map((app) => app.id)
145+
}).catch((error: AxiosError<ApiErrorDetail>) => {
146+
if (error.response?.data.detail.code === 1001) {
147+
flags.catalogIsUnknownSDK = true
148+
}
149+
150+
return error
143151
})
144152
} while (actualApps.length === params.limit)
145153

frontend/src/features/Apps/Header/ui/Header.vue

-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@
8383
icon="flipper:installed"
8484
label="Installed"
8585
:to="{ name: 'InstalledApps' }"
86-
:disable="appsStore.flags.catalogIsUnknownSDK"
8786
>
8887
<q-badge
8988
v-if="

frontend/src/widgets/Apps/InstalledList/ui/List.vue

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<template>
22
<div>
3-
<template v-if="globalStore.isOnline">
3+
<template
4+
v-if="globalStore.isOnline && !appsStore.flags.catalogIsUnknownSDK"
5+
>
46
<div
57
v-if="appsStore.updatableApps.length"
68
style="width: 140px"

0 commit comments

Comments
 (0)