From b5141cfd486a0ead55baad572649c6969b296c43 Mon Sep 17 00:00:00 2001 From: AlphaX-Projects <77661270+AlphaX-Projects@users.noreply.github.com> Date: Fri, 8 Dec 2023 09:07:30 +0100 Subject: [PATCH] Fix no metadata --- plugins/plugins/core/q-app/q-apps.src.js | 46 +++++++++++++++++++----- 1 file changed, 38 insertions(+), 8 deletions(-) diff --git a/plugins/plugins/core/q-app/q-apps.src.js b/plugins/plugins/core/q-app/q-apps.src.js index 22c33728..ae97bd86 100644 --- a/plugins/plugins/core/q-app/q-apps.src.js +++ b/plugins/plugins/core/q-app/q-apps.src.js @@ -1,7 +1,7 @@ import {css, html, LitElement} from 'lit' import {render} from 'lit/html.js' import {Epml} from '../../../epml.js' -import {get, registerTranslateConfig, translate, use} from '../../../../core/translate/index.js' +import {get, registerTranslateConfig, translate, use} from 'lit-translate' import isElectron from 'is-electron' import '@polymer/paper-spinner/paper-spinner-lite.js' import '@polymer/paper-dialog/paper-dialog.js' @@ -874,8 +874,18 @@ class QApps extends LitElement { this.appsArray.forEach(item => { const name = item.name - const title = item.metadata.title - const description = item.metadata.description + let title + if (item.metadata.title != null) { + title = item.metadata.title + } else { + title = item.name + } + let description + if (item.metadata.description != null) { + description = item.metadata.description + } else { + description = item.name + } const url = `${nodeUrl}/arbitrary/THUMBNAIL/${name}/qortal_avatar?async=true&apiKey=${this.getApiKey()}` let tags = 'No Tags' if (item.metadata.tags != null && item.metadata.tags.length > 0) { @@ -959,8 +969,18 @@ class QApps extends LitElement { this.followedResources.forEach(item => { const name = item.name - const title = item.metadata.title - const description = item.metadata.description + let title + if (item.metadata.title != null) { + title = item.metadata.title + } else { + title = item.name + } + let description + if (item.metadata.description != null) { + description = item.metadata.description + } else { + description = item.name + } const url = `${nodeUrl}/arbitrary/THUMBNAIL/${name}/qortal_avatar?async=true&apiKey=${this.getApiKey()}` let tags = 'No Tags' if (item.metadata.tags != null && item.metadata.tags.length > 0) { @@ -1045,8 +1065,18 @@ class QApps extends LitElement { this.blockedResources.forEach(item => { const name = item.name - const title = item.metadata.title - const description = item.metadata.description + let title + if (item.metadata.title != null) { + title = item.metadata.title + } else { + title = item.name + } + let description + if (item.metadata.description != null) { + description = item.metadata.description + } else { + description = item.name + } const url = `${nodeUrl}/arbitrary/THUMBNAIL/${name}/qortal_avatar?async=true&apiKey=${this.getApiKey()}` let tags = 'No Tags' if (item.metadata.tags != null && item.metadata.tags.length > 0) { @@ -1552,4 +1582,4 @@ class QApps extends LitElement { } } -window.customElements.define('q-apps', QApps) \ No newline at end of file +window.customElements.define('q-apps', QApps)