Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Commit

Permalink
logo image warning (#2190)
Browse files Browse the repository at this point in the history
  • Loading branch information
elsiosanchez authored Apr 26, 2024
1 parent 0c16925 commit bd304dd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default {
return this.$store.getters['user/getRole']
},
getResourceName() {
if (this.isEmptyValue(this.getRole) && this.isEmptyValue(this.getRole.client)) return ''
return this.$store.getters['user/getRole'].client.logo
}
},
Expand All @@ -40,7 +41,7 @@ export default {
},
async mounted() {
const { client } = this.getRole
if (client.logo) {
if (!this.isEmptyValue(client) && !this.isEmptyValue(client.logo)) {
const fileName = await getResourcePath({
clientId: client.id,
containerId: '109',
Expand Down
6 changes: 6 additions & 0 deletions src/layout/components/ProfilePreview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import { config } from '@/utils/ADempiere/config'
// Utils and Helper Methods
// import { getImagePath } from '@/utils/ADempiere/resource.js'
import { requestListResources } from '@/api/ADempiere/file-management/resource-reference.ts'
import { isEmptyValue } from '@/utils/ADempiere'
export default defineComponent({
name: 'ProfilePreview',
Expand Down Expand Up @@ -117,6 +118,11 @@ export default defineComponent({
tableName: 'AD_User'
})
.then(response => {
const { resources } = response
if (isEmptyValue(resources)) {
avatarResize.value = require('@/image/ADempiere/avatar/no-avatar.png')
return
}
const image = response.resources[0].name
avatarResize.value = config.adempiere.resource.url + image
return config.adempiere.resource.url + image
Expand Down

0 comments on commit bd304dd

Please sign in to comment.