Skip to content

Commit

Permalink
hotfix: Corrects logic when returning a catalog error
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxim Lyubimov committed Dec 14, 2023
1 parent bf21dde commit cac4159
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
9 changes: 9 additions & 0 deletions frontend/src/pages/Apps.vue
Expand Up @@ -129,6 +129,15 @@
</div>
</template>
</q-infinite-scroll>
<template v-if="!apps.length && !flags.loadingInitial">
<q-card flat>
<q-card-section class="q-pa-none q-ma-md" align="center">
<q-icon name="mdi-alert-circle" color="primary" size="64px" />
<div class="text-h6 q-my-sm">Not Compatible with your Firmware</div>
<p>To access this category, install the latest firmware version from <span class="text-positive">Release</span> Channel on your Flipper</p>
</q-card-section>
</q-card>
</template>
</q-page>
</template>
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/stores/apps.js
Expand Up @@ -646,6 +646,9 @@ export const useAppsStore = defineStore('apps', () => {
}

flags.value.loadingInitial = false
}).catch(() => {
flags.value.loadingInitial = false
flags.value.fetchEnd = true
})
} else {
flags.value.loadingInitial = false
Expand Down
5 changes: 2 additions & 3 deletions frontend/src/util/fetch.js
Expand Up @@ -153,9 +153,8 @@ async function fetchAppsShort (params) {
})
}).catch((error) => {
if (error.code !== 'ERR_CANCELED') {
const data = error.response.data.detail
if (data.code >= 400) {
throw new Error('Failed to fetch resources (' + data.code + ')')
if (error.response.status >= 400) {
throw new Error('Failed to fetch resources (' + error.response.status + ')')
}
}
})
Expand Down

0 comments on commit cac4159

Please sign in to comment.