From eeca17b1f0a0d076474ff52ccce67113ea356fb4 Mon Sep 17 00:00:00 2001
From: AlphaX-Projects <77661270+AlphaX-Projects@users.noreply.github.com>
Date: Mon, 24 Jan 2022 04:13:56 +0100
Subject: [PATCH] Search Result Name Not Found
---
.../plugins/core/qdn/websites.src.js | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/qortal-ui-plugins/plugins/core/qdn/websites.src.js b/qortal-ui-plugins/plugins/core/qdn/websites.src.js
index d56b31dd..da3d1a03 100644
--- a/qortal-ui-plugins/plugins/core/qdn/websites.src.js
+++ b/qortal-ui-plugins/plugins/core/qdn/websites.src.js
@@ -15,14 +15,14 @@ class Websites extends LitElement {
static get properties() {
return {
service: { type: String },
- identifier: { type: String },
+ identifier: { type: String },
loading: { type: Boolean },
resources: { type: Array },
followedNames: { type: Array },
blockedNames: { type: Array },
relayMode: { type: Boolean },
selectedAddress: { type: Object },
- searchName: { type: String },
+ searchName: { type: String },
searchResources: { type: Array },
searchFollowedNames: { type: Array },
searchBlockedNames: { type: Array }
@@ -119,7 +119,7 @@ class Websites extends LitElement {
constructor() {
super()
this.service = "WEBSITE"
- this.identifier = null
+ this.identifier = null
this.selectedAddress = {}
this.resources = []
this.followedNames = []
@@ -155,7 +155,7 @@ class Websites extends LitElement {
{
render(html`${this.renderSearchStatus(data.item)}`, root)
}}>
- {
+ {
render(html`${this.renderSearchSize(data.item)}`, root)
}}>
{
@@ -176,7 +176,7 @@ class Websites extends LitElement {
{
render(html`${this.renderStatus(data.item)}`, root)
}}>
- {
+ {
render(html`${this.renderSize(data.item)}`, root)
}}>
{
@@ -303,12 +303,16 @@ class Websites extends LitElement {
async searchResult() {
let searchName = this.shadowRoot.getElementById('searchName').value
if (searchName.length === 0) {
- parentEpml.request('showSnackBar', 'Name cannot be empty!')
+ parentEpml.request('showSnackBar', 'Name Can Not Be Empty!')
} else {
let searchResources = await parentEpml.request('apiCall', {
url: `/arbitrary/resources/search?service=${this.service}&query=${searchName}&default=true&limit=5&reverse=false&includestatus=true`
})
- this.searchResources = searchResources
+ if (this.isEmptyArray(searchResources)) {
+ parentEpml.request('showSnackBar', 'Name Not Found!')
+ } else {
+ this.searchResources = searchResources
+ }
}
}