From f0897e2982ab5cd64cd7a2fe89b3e6d3a128a4d5 Mon Sep 17 00:00:00 2001 From: AlphaX-Projects <77661270+AlphaX-Projects@users.noreply.github.com> Date: Sun, 30 Apr 2023 09:18:14 +0200 Subject: [PATCH] Fix page counter --- .../plugins/core/q-app/q-apps.src.js | 20 ++++++++++++------- .../plugins/core/qdn/websites.src.js | 14 +++++++++---- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/qortal-ui-plugins/plugins/core/q-app/q-apps.src.js b/qortal-ui-plugins/plugins/core/q-app/q-apps.src.js index 342380ee..fd90bb76 100644 --- a/qortal-ui-plugins/plugins/core/q-app/q-apps.src.js +++ b/qortal-ui-plugins/plugins/core/q-app/q-apps.src.js @@ -760,7 +760,7 @@ class QApps extends LitElement { } else { offset = 0 } - this.getData(offset); + this.getData(offset) const selectedPage = parseInt(this.pagesControl.querySelector('[selected]').textContent) this.updateItemsFromPage(selectedPage - 1) }) @@ -776,7 +776,7 @@ class QApps extends LitElement { } else { offset = 0 } - this.getData(offset); + this.getData(offset) this.updateItemsFromPage(parseInt(e.target.textContent)) }) if (pageNumber === page) { @@ -793,7 +793,7 @@ class QApps extends LitElement { } else { offset = 0 } - this.getData(offset); + this.getData(offset) const selectedPage = parseInt(this.pagesControl.querySelector('[selected]').textContent) this.updateItemsFromPage(selectedPage + 1) }) @@ -831,6 +831,12 @@ class QApps extends LitElement { await this.updateItemsFromPage(1, true) } + async refreshapps() { + await this.getData(0) + await this.getArbitraryResources() + await this.updateItemsFromPage(1, true) + } + doSearch(e) { this.searchResult() } @@ -1008,7 +1014,7 @@ class QApps extends LitElement { this.followedNames.push(name) this.getFollowedNamesRefresh() this.getFollowedNamesResource() - this.getArbitraryResources() + this.refreshapps() this.updateComplete.then(() => this.requestUpdate()) } else { let err3string = get("appspage.schange22") @@ -1037,7 +1043,7 @@ class QApps extends LitElement { this.followedNames = this.followedNames.filter(item => item != name) this.getFollowedNamesRefresh() this.getFollowedNamesResource() - this.getArbitraryResources() + this.refreshapps() this.updateComplete.then(() => this.requestUpdate()) } else { let err4string = get("appspage.schange23") @@ -1067,7 +1073,7 @@ class QApps extends LitElement { this.blockedNames.push(name) this.getBlockedNamesRefresh() this.getBlockedNamesResource() - this.getArbitraryResources() + this.refreshapps() this.updateComplete.then(() => this.requestUpdate()) } else { let err5string = get("appspage.schange24") @@ -1096,7 +1102,7 @@ class QApps extends LitElement { this.blockedNames = this.blockedNames.filter(item => item != name) this.getBlockedNamesRefresh() this.getBlockedNamesResource() - this.getArbitraryResources() + this.refreshapps() this.updateComplete.then(() => this.requestUpdate()) } else { let err6string = get("appspage.schange25") diff --git a/qortal-ui-plugins/plugins/core/qdn/websites.src.js b/qortal-ui-plugins/plugins/core/qdn/websites.src.js index 86646ee2..e412bd92 100644 --- a/qortal-ui-plugins/plugins/core/qdn/websites.src.js +++ b/qortal-ui-plugins/plugins/core/qdn/websites.src.js @@ -676,6 +676,12 @@ class Websites extends LitElement { await this.updateItemsFromPage(1, true) } + async refreshWebsites() { + await this.getData(0) + await this.getArbitraryResources() + await this.updateItemsFromPage(1, true) + } + doSearch(e) { this.searchResult() } @@ -753,7 +759,7 @@ class Websites extends LitElement { this.followedNames.push(name) this.getFollowedNamesRefresh() this.getFollowedNamesResource() - this.getArbitraryResources() + this.refreshWebsites() this.updateComplete.then(() => this.requestUpdate()) } else { let err3string = get("websitespage.schange22") @@ -783,7 +789,7 @@ class Websites extends LitElement { this.followedNames = this.followedNames.filter(item => item != name) this.getFollowedNamesRefresh() this.getFollowedNamesResource() - this.getArbitraryResources() + this.refreshWebsites() this.updateComplete.then(() => this.requestUpdate()) } else { let err4string = get("websitespage.schange23") @@ -816,7 +822,7 @@ class Websites extends LitElement { this.blockedNames.push(name) this.getBlockedNamesRefresh() this.getBlockedNamesResource() - this.getArbitraryResources() + this.refreshWebsites() this.updateComplete.then(() => this.requestUpdate()) } else { let err5string = get("websitespage.schange24") @@ -846,7 +852,7 @@ class Websites extends LitElement { this.blockedNames = this.blockedNames.filter(item => item != name) this.getBlockedNamesRefresh() this.getBlockedNamesResource() - this.getArbitraryResources() + this.refreshWebsites() this.updateComplete.then(() => this.requestUpdate()) } else { let err6string = get("websitespage.schange25")