From 5c2ce14f2adf9404ced4878530a1d74706ca3530 Mon Sep 17 00:00:00 2001 From: AlphaX-Projects <77661270+AlphaX-Projects@users.noreply.github.com> Date: Tue, 1 Aug 2023 19:25:57 +0200 Subject: [PATCH] clear memory --- .../core/become-minter/become-minter.src.js | 12 ++++ .../become-minter/components/not-sponsored.js | 64 +++++++++---------- .../become-minter/components/yes-sponsored.js | 39 +++++------ .../plugins/core/components/ChatScroller.js | 26 ++++++++ .../core/components/ChatSideNavHeads.js | 2 +- .../core/components/ChatWelcomePage.js | 7 +- .../group-management/group-management.src.js | 12 ++++ plugins/plugins/core/main.src.js | 22 +++---- .../chain-messaging/chain-messaging.src.js | 26 ++++++-- .../plugins/core/messaging/messaging.src.js | 17 +++-- .../core/messaging/q-chat/q-chat.src.js | 12 ++++ .../plugins/core/minting/minting-info.src.js | 13 +++- .../name-registration.src.js | 13 +++- .../core/names-market/names-market.src.js | 12 ++++ .../node-management/node-management.src.js | 13 +++- .../core/overview-page/overview-page.src.js | 13 ++++ plugins/plugins/core/puzzles/puzzles.src.js | 15 ++++- plugins/plugins/core/q-app/q-apps.src.js | 13 +++- .../plugins/core/qdn/browser/browser.src.js | 12 ++++ .../data-management/data-management.src.js | 13 +++- .../plugins/core/qdn/publish/publish.src.js | 13 +++- plugins/plugins/core/qdn/websites.src.js | 13 +++- .../core/reward-share/reward-share.src.js | 18 +++++- .../sponsorship-list/sponsorship-list.src.js | 17 +++++ .../core/trade-bot/trade-bot-portal.src.js | 13 +++- .../core/trade-portal/trade-portal.src.js | 25 ++++++-- plugins/plugins/core/wallet/wallet-app.src.js | 14 +++- 27 files changed, 370 insertions(+), 99 deletions(-) diff --git a/plugins/plugins/core/become-minter/become-minter.src.js b/plugins/plugins/core/become-minter/become-minter.src.js index 4f7cf61f..0a9033d4 100644 --- a/plugins/plugins/core/become-minter/become-minter.src.js +++ b/plugins/plugins/core/become-minter/become-minter.src.js @@ -134,6 +134,18 @@ class BecomeMinter extends LitElement { window.parent.electronAPI.showMyMenu() }) } + this.clearConsole() + setInterval(() => { + this.clearConsole() + }, 60000) + } + + clearConsole() { + if (!isElectron()) { + } else { + console.clear() + window.parent.electronAPI.clearCache() + } } async getRewardShareRelationship(recipientAddress) { diff --git a/plugins/plugins/core/become-minter/components/not-sponsored.js b/plugins/plugins/core/become-minter/components/not-sponsored.js index c298b55c..380a992a 100644 --- a/plugins/plugins/core/become-minter/components/not-sponsored.js +++ b/plugins/plugins/core/become-minter/components/not-sponsored.js @@ -1,19 +1,15 @@ -import { LitElement, html } from 'lit'; -import { Epml } from '../../../../epml.js'; -import '../../components/ButtonIconCopy.js'; -import { use, translate, registerTranslateConfig } from 'lit-translate'; +import { LitElement, html } from 'lit' +import { Epml } from '../../../../epml.js' +import '../../components/ButtonIconCopy.js' +import { use, get, translate, registerTranslateConfig } from 'lit-translate' -registerTranslateConfig({ - loader: (lang) => fetch(`/language/${lang}.json`).then((res) => res.json()), -}); +import '@polymer/paper-spinner/paper-spinner-lite.js' +import '@material/mwc-button' +import '@material/mwc-textfield' +import '@vaadin/button' +import { pageStyles } from '../become-minter-css.src.js' -import '@polymer/paper-spinner/paper-spinner-lite.js'; -import '@material/mwc-button'; -import '@material/mwc-textfield'; -import '@vaadin/button'; -import { pageStyles } from '../become-minter-css.src.js'; - -const parentEpml = new Epml({ type: 'WINDOW', source: window.parent }); +const parentEpml = new Epml({ type: 'WINDOW', source: window.parent }) class NotSponsored extends LitElement { static properties = { @@ -27,18 +23,18 @@ class NotSponsored extends LitElement { constructor() { super(); - this.isLoadingSponsorshipKeySubmit = false; - this.sponsorshipKeyValue = ''; - this.addMintingAccountMessage = ''; - this.atMount = () => {}; + this.isLoadingSponsorshipKeySubmit = false + this.sponsorshipKeyValue = '' + this.addMintingAccountMessage = '' + this.atMount = () => {} } renderErr1Text() { - return html`${translate('nodepage.nchange27')}`; + return html`${translate('nodepage.nchange27')}` } renderErr2Text() { - return html`${translate('nodepage.nchange28')}`; + return html`${translate('nodepage.nchange28')}` } getApiKey() { @@ -46,13 +42,13 @@ class NotSponsored extends LitElement { window.parent.reduxStore.getState().app.nodeConfig.knownNodes[ window.parent.reduxStore.getState().app.nodeConfig.node ]; - let apiKey = myNode.apiKey; - return apiKey; + let apiKey = myNode.apiKey + return apiKey } addMintingAccount(e) { - this.isLoadingSponsorshipKeySubmit = true; - this.addMintingAccountMessage = 'Loading...'; + this.isLoadingSponsorshipKeySubmit = true + this.addMintingAccountMessage = 'Loading...' parentEpml .request('apiCall', { @@ -63,20 +59,20 @@ class NotSponsored extends LitElement { .then((res) => { if (res === true) { // refetch data - this.atMount(); - this.sponsorshipKeyValue = ''; - this.addMintingAccountMessage = this.renderErr1Text(); - this.isLoadingSponsorshipKeySubmit = false; + this.atMount() + this.sponsorshipKeyValue = '' + this.addMintingAccountMessage = this.renderErr1Text() + this.isLoadingSponsorshipKeySubmit = false } else { this.sponsorshipKeyValue = ''; - this.addMintingAccountMessage = this.renderErr2Text(); - this.isLoadingSponsorshipKeySubmit = false; + this.addMintingAccountMessage = this.renderErr2Text() + this.isLoadingSponsorshipKeySubmit = false } - }); + }) } inputHandler(e) { - this.sponsorshipKeyValue = e.target.value; + this.sponsorshipKeyValue = e.target.value } render() { @@ -130,8 +126,8 @@ class NotSponsored extends LitElement { - `; + ` } } -window.customElements.define('not-sponsored', NotSponsored); +window.customElements.define('not-sponsored', NotSponsored) diff --git a/plugins/plugins/core/become-minter/components/yes-sponsored.js b/plugins/plugins/core/become-minter/components/yes-sponsored.js index 901c48d3..f4eea8cf 100644 --- a/plugins/plugins/core/become-minter/components/yes-sponsored.js +++ b/plugins/plugins/core/become-minter/components/yes-sponsored.js @@ -1,18 +1,14 @@ -import { LitElement, html } from 'lit'; -import { Epml } from '../../../../epml.js'; -import '../../components/ButtonIconCopy.js'; -import { use, translate, registerTranslateConfig } from 'lit-translate'; +import { LitElement, html } from 'lit' +import { Epml } from '../../../../epml.js' +import '../../components/ButtonIconCopy.js' +import { use, get, translate, registerTranslateConfig } from 'lit-translate' -registerTranslateConfig({ - loader: (lang) => fetch(`/language/${lang}.json`).then((res) => res.json()), -}); - -import '@polymer/paper-spinner/paper-spinner-lite.js'; -import '@material/mwc-button'; -import '@material/mwc-textfield'; -import '@vaadin/button'; -import { blocksNeed } from '../../../utils/blocks-needed.js'; -import { pageStyles } from '../become-minter-css.src.js'; +import '@polymer/paper-spinner/paper-spinner-lite.js' +import '@material/mwc-button' +import '@material/mwc-textfield' +import '@vaadin/button' +import { blocksNeed } from '../../../utils/blocks-needed.js' +import { pageStyles } from '../become-minter-css.src.js' class YesSponsored extends LitElement { static get properties() { @@ -24,14 +20,13 @@ class YesSponsored extends LitElement { } constructor() { - super(); - - this.addressInfo = {}; - this.rewardSharePublicKey = ''; + super() + this.addressInfo = {} + this.rewardSharePublicKey = '' this.isMinting = false } - static styles = [pageStyles]; + static styles = [pageStyles] _levelUpBlocks() { let countBlocksString = ( @@ -39,7 +34,7 @@ class YesSponsored extends LitElement { (this.addressInfo?.blocksMinted + this.addressInfo?.blocksMintedAdjustment) ).toString(); - return countBlocksString; + return countBlocksString } render() { @@ -107,8 +102,8 @@ class YesSponsored extends LitElement { - `; + ` } } -window.customElements.define('yes-sponsored', YesSponsored); +window.customElements.define('yes-sponsored', YesSponsored) diff --git a/plugins/plugins/core/components/ChatScroller.js b/plugins/plugins/core/components/ChatScroller.js index f2d06735..f5ee24de 100644 --- a/plugins/plugins/core/components/ChatScroller.js +++ b/plugins/plugins/core/components/ChatScroller.js @@ -9,6 +9,7 @@ import { cropAddress } from "../../utils/cropAddress" import { roundToNearestDecimal } from '../../utils/roundToNearestDecimal.js' import { EmojiPicker } from 'emoji-picker-js' import { generateHTML } from '@tiptap/core' +import isElectron from 'is-electron' import axios from 'axios' import Highlight from '@tiptap/extension-highlight' @@ -362,6 +363,19 @@ class ChatScroller extends LitElement { this.downElementObserver() await this.getUpdateComplete() this.viewElement.scrollTop = this.viewElement.scrollHeight + 50 + + this.clearConsole() + setInterval(() => { + this.clearConsole() + }, 60000) + } + + clearConsole() { + if (!isElectron()) { + } else { + console.clear() + window.parent.electronAPI.clearCache() + } } changeTheme() { @@ -568,6 +582,18 @@ class MessageTemplate extends LitElement { overlay.shadowRoot.getElementById("overlay").style.cssText = "background-color: transparent; box-shadow: rgb(50 50 93 / 25%) 0px 2px 5px -1px, rgb(0 0 0 / 30%) 0px 1px 3px -1px" overlay.shadowRoot.getElementById('content').style.cssText = "background-color: var(--reactions-tooltip-bg); color: var(--chat-bubble-msg-color); text-align: center; padding: 20px 10px; border-radius: 8px; font-family: Roboto, sans-serif; letter-spacing: 0.3px; font-weight: 300; font-size: 13.5px; transition: all 0.3s ease-in-out;" }) + this.clearConsole() + setInterval(() => { + this.clearConsole() + }, 60000) + } + + clearConsole() { + if (!isElectron()) { + } else { + console.clear() + window.parent.electronAPI.clearCache() + } } render() { diff --git a/plugins/plugins/core/components/ChatSideNavHeads.js b/plugins/plugins/core/components/ChatSideNavHeads.js index f9b8bd44..61003f7a 100644 --- a/plugins/plugins/core/components/ChatSideNavHeads.js +++ b/plugins/plugins/core/components/ChatSideNavHeads.js @@ -177,7 +177,7 @@ class ChatSideNavHeads extends LitElement { this.config = JSON.parse(c) }) }) - parentEpml.imReady(); + parentEpml.imReady() } shouldUpdate(changedProperties) { diff --git a/plugins/plugins/core/components/ChatWelcomePage.js b/plugins/plugins/core/components/ChatWelcomePage.js index 18ec1637..1deb25d1 100644 --- a/plugins/plugins/core/components/ChatWelcomePage.js +++ b/plugins/plugins/core/components/ChatWelcomePage.js @@ -2,6 +2,7 @@ import { LitElement, html, css } from 'lit' import { render } from 'lit/html.js' import { Epml } from '../../../epml.js' import { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from 'lit-translate' +import isElectron from 'is-electron' import '@material/mwc-icon' import '@material/mwc-button' @@ -314,7 +315,11 @@ class ChatWelcomePage extends LitElement { } clearConsole() { - console.clear() + if (!isElectron()) { + } else { + console.clear() + window.parent.electronAPI.clearCache() + } } changeTheme() { diff --git a/plugins/plugins/core/group-management/group-management.src.js b/plugins/plugins/core/group-management/group-management.src.js index 7e1e7f57..bd35cc58 100644 --- a/plugins/plugins/core/group-management/group-management.src.js +++ b/plugins/plugins/core/group-management/group-management.src.js @@ -1849,6 +1849,18 @@ class GroupManagement extends LitElement { }) }) parentEpml.imReady() + this.clearConsole() + setInterval(() => { + this.clearConsole() + }, 60000) + } + + clearConsole() { + if (!isElectron()) { + } else { + console.clear() + window.parent.electronAPI.clearCache() + } } changeTheme() { diff --git a/plugins/plugins/core/main.src.js b/plugins/plugins/core/main.src.js index 884b949c..56daa295 100644 --- a/plugins/plugins/core/main.src.js +++ b/plugins/plugins/core/main.src.js @@ -1,8 +1,8 @@ import { parentEpml } from './connect.js'; import './streams/streams.js'; -let config = {}; -let haveRegisteredNodeManagement = false; +let config = {} +let haveRegisteredNodeManagement = false parentEpml.ready().then(() => { // pluginUrlsConf @@ -186,20 +186,20 @@ parentEpml.ready().then(() => { ]; const registerPlugins = (pluginInfo) => { - parentEpml.request('registerUrl', pluginInfo); + parentEpml.request('registerUrl', pluginInfo) }; const checkNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[ window.parent.reduxStore.getState().app.nodeConfig.node - ]; + ] parentEpml.subscribe('config', (c) => { - config = JSON.parse(c); + config = JSON.parse(c) // Only register node management if node management is enabled and it hasn't already been registered if (!haveRegisteredNodeManagement && checkNode.enableManagement) { - haveRegisteredNodeManagement = true; + haveRegisteredNodeManagement = true let nodeManagementConf = { url: 'node-management', @@ -213,10 +213,10 @@ parentEpml.ready().then(() => { parent: false, }; - let _pluginUrlsConf = [...pluginUrlsConf, nodeManagementConf]; - registerPlugins(_pluginUrlsConf); + let _pluginUrlsConf = [...pluginUrlsConf, nodeManagementConf] + registerPlugins(_pluginUrlsConf) } else { - registerPlugins(pluginUrlsConf); + registerPlugins(pluginUrlsConf) } - }); -}); \ No newline at end of file + }) +}) \ No newline at end of file diff --git a/plugins/plugins/core/messaging/chain-messaging/chain-messaging.src.js b/plugins/plugins/core/messaging/chain-messaging/chain-messaging.src.js index 7b38cd56..7b9de6e1 100644 --- a/plugins/plugins/core/messaging/chain-messaging/chain-messaging.src.js +++ b/plugins/plugins/core/messaging/chain-messaging/chain-messaging.src.js @@ -1,6 +1,10 @@ import { LitElement, html, css } from 'lit' +import { render } from 'lit/html.js' +import { Epml } from '../../../../epml.js' import isElectron from 'is-electron' +const parentEpml = new Epml({ type: 'WINDOW', source: window.parent }) + class ChainMessaging extends LitElement { static get properties() { return { @@ -44,12 +48,18 @@ class ChainMessaging extends LitElement { } firstUpdated() { - this.changeTheme() - setInterval(() => { - this.changeTheme(); - }, 100) + window.addEventListener('storage', () => { + const checkTheme = localStorage.getItem('qortalTheme') + + if (checkTheme === 'dark') { + this.theme = 'dark' + } else { + this.theme = 'light' + } + document.querySelector('html').setAttribute('theme', this.theme) + }) if (!isElectron()) { } else { @@ -60,6 +70,14 @@ class ChainMessaging extends LitElement { } } + clearConsole() { + if (!isElectron()) { + } else { + console.clear() + window.parent.electronAPI.clearCache() + } + } + changeTheme() { const checkTheme = localStorage.getItem('qortalTheme') if (checkTheme === 'dark') { diff --git a/plugins/plugins/core/messaging/messaging.src.js b/plugins/plugins/core/messaging/messaging.src.js index 8a3b093f..cf7316ac 100644 --- a/plugins/plugins/core/messaging/messaging.src.js +++ b/plugins/plugins/core/messaging/messaging.src.js @@ -138,13 +138,8 @@ class Messaging extends LitElement { } firstUpdated() { - this.changeTheme() - setInterval(() => { - this.changeTheme(); - }, 100) - if (!isElectron()) { } else { window.addEventListener('contextmenu', (event) => { @@ -170,6 +165,18 @@ class Messaging extends LitElement { }) }) parentEpml.imReady() + this.clearConsole() + setInterval(() => { + this.clearConsole() + }, 60000) + } + + clearConsole() { + if (!isElectron()) { + } else { + console.clear() + window.parent.electronAPI.clearCache() + } } changeTheme() { diff --git a/plugins/plugins/core/messaging/q-chat/q-chat.src.js b/plugins/plugins/core/messaging/q-chat/q-chat.src.js index e6870cc0..1f60e079 100644 --- a/plugins/plugins/core/messaging/q-chat/q-chat.src.js +++ b/plugins/plugins/core/messaging/q-chat/q-chat.src.js @@ -468,6 +468,18 @@ class Chat extends LitElement { }) }) parentEpml.imReady() + this.clearConsole() + setInterval(() => { + this.clearConsole() + }, 60000) + } + + clearConsole() { + if (!isElectron()) { + } else { + console.clear() + window.parent.electronAPI.clearCache() + } } setOpenPrivateMessage(props) { diff --git a/plugins/plugins/core/minting/minting-info.src.js b/plugins/plugins/core/minting/minting-info.src.js index fab86ced..49304129 100644 --- a/plugins/plugins/core/minting/minting-info.src.js +++ b/plugins/plugins/core/minting/minting-info.src.js @@ -347,7 +347,6 @@ class MintingInfo extends LitElement { } async firstUpdated() { - this.changeTheme() this.changeLanguage() @@ -429,6 +428,18 @@ class MintingInfo extends LitElement { }) }) parentEpml.imReady() + this.clearConsole() + setInterval(() => { + this.clearConsole() + }, 60000) + } + + clearConsole() { + if (!isElectron()) { + } else { + console.clear() + window.parent.electronAPI.clearCache() + } } async getAddressLevel() { diff --git a/plugins/plugins/core/name-registration/name-registration.src.js b/plugins/plugins/core/name-registration/name-registration.src.js index 7e1e3f01..fd7d80b4 100644 --- a/plugins/plugins/core/name-registration/name-registration.src.js +++ b/plugins/plugins/core/name-registration/name-registration.src.js @@ -537,7 +537,6 @@ class NameRegistration extends LitElement { } firstUpdated() { - this.changeTheme() this.changeLanguage() this.unitFee() @@ -604,6 +603,18 @@ class NameRegistration extends LitElement { }) }) parentEpml.imReady() + this.clearConsole() + setInterval(() => { + this.clearConsole() + }, 60000) + } + + clearConsole() { + if (!isElectron()) { + } else { + console.clear() + window.parent.electronAPI.clearCache() + } } changeTheme() { diff --git a/plugins/plugins/core/names-market/names-market.src.js b/plugins/plugins/core/names-market/names-market.src.js index d020f297..d3638920 100644 --- a/plugins/plugins/core/names-market/names-market.src.js +++ b/plugins/plugins/core/names-market/names-market.src.js @@ -609,6 +609,18 @@ class NamesMarket extends LitElement { }) }) parentEpml.imReady() + this.clearConsole() + setInterval(() => { + this.clearConsole() + }, 60000) + } + + clearConsole() { + if (!isElectron()) { + } else { + console.clear() + window.parent.electronAPI.clearCache() + } } displayTabContent(tab) { diff --git a/plugins/plugins/core/node-management/node-management.src.js b/plugins/plugins/core/node-management/node-management.src.js index cd36187c..27ffdabc 100644 --- a/plugins/plugins/core/node-management/node-management.src.js +++ b/plugins/plugins/core/node-management/node-management.src.js @@ -278,7 +278,6 @@ class NodeManagement extends LitElement { } firstUpdated() { - this.changeTheme() this.changeLanguage() this.updateMintingAccounts() @@ -363,6 +362,18 @@ class NodeManagement extends LitElement { }) }) parentEpml.imReady() + this.clearConsole() + setInterval(() => { + this.clearConsole() + }, 60000) + } + + clearConsole() { + if (!isElectron()) { + } else { + console.clear() + window.parent.electronAPI.clearCache() + } } changeTheme() { diff --git a/plugins/plugins/core/overview-page/overview-page.src.js b/plugins/plugins/core/overview-page/overview-page.src.js index 919560df..6b6d206e 100644 --- a/plugins/plugins/core/overview-page/overview-page.src.js +++ b/plugins/plugins/core/overview-page/overview-page.src.js @@ -180,6 +180,19 @@ class OverviewPage extends LitElement { setInterval(() => { this.getAvatar() }, 180000) + + this.clearConsole() + setInterval(() => { + this.clearConsole() + }, 60000) + } + + clearConsole() { + if (!isElectron()) { + } else { + console.clear() + window.parent.electronAPI.clearCache() + } } changeTheme() { diff --git a/plugins/plugins/core/puzzles/puzzles.src.js b/plugins/plugins/core/puzzles/puzzles.src.js index ff3da640..75611c11 100644 --- a/plugins/plugins/core/puzzles/puzzles.src.js +++ b/plugins/plugins/core/puzzles/puzzles.src.js @@ -180,7 +180,6 @@ class Puzzles extends LitElement { } firstUpdated() { - this.changeTheme() this.changeLanguage() @@ -308,7 +307,7 @@ class Puzzles extends LitElement { this.puzzles = _puzzles; - setTimeout(updatePuzzles, 20000) + setTimeout(updatePuzzles, 60000) } let configLoaded = false @@ -330,6 +329,18 @@ class Puzzles extends LitElement { }) }) parentEpml.imReady() + this.clearConsole() + setInterval(() => { + this.clearConsole() + }, 60000) + } + + clearConsole() { + if (!isElectron()) { + } else { + console.clear() + window.parent.electronAPI.clearCache() + } } changeTheme() { diff --git a/plugins/plugins/core/q-app/q-apps.src.js b/plugins/plugins/core/q-app/q-apps.src.js index 43676494..37b502e2 100644 --- a/plugins/plugins/core/q-app/q-apps.src.js +++ b/plugins/plugins/core/q-app/q-apps.src.js @@ -544,7 +544,6 @@ class QApps extends LitElement { } firstUpdated() { - this.changeTheme() this.changeLanguage() this.showapps() @@ -624,6 +623,18 @@ class QApps extends LitElement { }) }) parentEpml.imReady() + this.clearConsole() + setInterval(() => { + this.clearConsole() + }, 60000) + } + + clearConsole() { + if (!isElectron()) { + } else { + console.clear() + window.parent.electronAPI.clearCache() + } } changeTheme() { diff --git a/plugins/plugins/core/qdn/browser/browser.src.js b/plugins/plugins/core/qdn/browser/browser.src.js index 23816ecf..98617950 100644 --- a/plugins/plugins/core/qdn/browser/browser.src.js +++ b/plugins/plugins/core/qdn/browser/browser.src.js @@ -2657,6 +2657,18 @@ class WebBrowser extends LitElement { }); } }); + this.clearConsole() + setInterval(() => { + this.clearConsole() + }, 60000) + } + + clearConsole() { + if (!isElectron()) { + } else { + console.clear() + window.parent.electronAPI.clearCache() + } } changeTheme() { diff --git a/plugins/plugins/core/qdn/data-management/data-management.src.js b/plugins/plugins/core/qdn/data-management/data-management.src.js index 4107fe94..1bcc2d13 100644 --- a/plugins/plugins/core/qdn/data-management/data-management.src.js +++ b/plugins/plugins/core/qdn/data-management/data-management.src.js @@ -441,7 +441,6 @@ class DataManagement extends LitElement { } firstUpdated() { - this.changeTheme() this.changeLanguage() this.showManagement() @@ -494,6 +493,18 @@ class DataManagement extends LitElement { }) }) parentEpml.imReady() + this.clearConsole() + setInterval(() => { + this.clearConsole() + }, 60000) + } + + clearConsole() { + if (!isElectron()) { + } else { + console.clear() + window.parent.electronAPI.clearCache() + } } changeTheme() { diff --git a/plugins/plugins/core/qdn/publish/publish.src.js b/plugins/plugins/core/qdn/publish/publish.src.js index 06cc2514..08372934 100644 --- a/plugins/plugins/core/qdn/publish/publish.src.js +++ b/plugins/plugins/core/qdn/publish/publish.src.js @@ -318,7 +318,6 @@ class PublishData extends LitElement { } firstUpdated() { - this.changeTheme() this.changeLanguage() @@ -343,6 +342,18 @@ class PublishData extends LitElement { window.parent.electronAPI.showMyMenu() }) } + this.clearConsole() + setInterval(() => { + this.clearConsole() + }, 60000) + } + + clearConsole() { + if (!isElectron()) { + } else { + console.clear() + window.parent.electronAPI.clearCache() + } } changeTheme() { diff --git a/plugins/plugins/core/qdn/websites.src.js b/plugins/plugins/core/qdn/websites.src.js index 600584a1..3431d1f9 100644 --- a/plugins/plugins/core/qdn/websites.src.js +++ b/plugins/plugins/core/qdn/websites.src.js @@ -398,7 +398,6 @@ class Websites extends LitElement { } firstUpdated() { - this.changeTheme() this.changeLanguage() this.showWebsites() @@ -478,6 +477,18 @@ class Websites extends LitElement { }) }) parentEpml.imReady() + this.clearConsole() + setInterval(() => { + this.clearConsole() + }, 60000) + } + + clearConsole() { + if (!isElectron()) { + } else { + console.clear() + window.parent.electronAPI.clearCache() + } } changeTheme() { diff --git a/plugins/plugins/core/reward-share/reward-share.src.js b/plugins/plugins/core/reward-share/reward-share.src.js index 2ee29c18..12e59a25 100644 --- a/plugins/plugins/core/reward-share/reward-share.src.js +++ b/plugins/plugins/core/reward-share/reward-share.src.js @@ -211,7 +211,6 @@ class RewardShare extends LitElement { } firstUpdated() { - this.changeTheme() this.changeLanguage() @@ -238,12 +237,13 @@ class RewardShare extends LitElement { } const updateRewardshares = () => { + this.rewardShares = [] parentEpml.request('apiCall', { url: `/addresses/rewardshares?involving=${this.selectedAddress.address}` }).then(res => { - setTimeout(() => { this.rewardShares = res }, 1) + this.rewardShares = res }) - setTimeout(updateRewardshares, this.config.user.nodeSettings.pingInterval) + setTimeout(updateRewardshares, 60000) } let configLoaded = false @@ -266,6 +266,18 @@ class RewardShare extends LitElement { }) parentEpml.imReady() + this.clearConsole() + setInterval(() => { + this.clearConsole() + }, 60000) + } + + clearConsole() { + if (!isElectron()) { + } else { + console.clear() + window.parent.electronAPI.clearCache() + } } changeTheme() { diff --git a/plugins/plugins/core/sponsorship-list/sponsorship-list.src.js b/plugins/plugins/core/sponsorship-list/sponsorship-list.src.js index 2930c7de..978930a2 100644 --- a/plugins/plugins/core/sponsorship-list/sponsorship-list.src.js +++ b/plugins/plugins/core/sponsorship-list/sponsorship-list.src.js @@ -406,6 +406,23 @@ class SponsorshipList extends LitElement { window.parent.electronAPI.showMyMenu() }) } + + setInterval(() => { + this.atMount() + }, 180000) + + this.clearConsole() + setInterval(() => { + this.clearConsole() + }, 60000) + } + + clearConsole() { + if (!isElectron()) { + } else { + console.clear() + window.parent.electronAPI.clearCache() + } } renderCopyMsg() { diff --git a/plugins/plugins/core/trade-bot/trade-bot-portal.src.js b/plugins/plugins/core/trade-bot/trade-bot-portal.src.js index 3b3c0802..e34f1b66 100644 --- a/plugins/plugins/core/trade-bot/trade-bot-portal.src.js +++ b/plugins/plugins/core/trade-bot/trade-bot-portal.src.js @@ -2100,7 +2100,6 @@ class TradeBotPortal extends LitElement { } firstUpdated() { - let _this = this this.changeTheme() @@ -2281,6 +2280,18 @@ class TradeBotPortal extends LitElement { this.dgbTradebook() this.rvnTradebook() this.arrrTradebook() + this.clearConsole() + setInterval(() => { + this.clearConsole() + }, 60000) + } + + clearConsole() { + if (!isElectron()) { + } else { + console.clear() + window.parent.electronAPI.clearCache() + } } renderAutoLockButton() { diff --git a/plugins/plugins/core/trade-portal/trade-portal.src.js b/plugins/plugins/core/trade-portal/trade-portal.src.js index d5ce42df..e74a5392 100644 --- a/plugins/plugins/core/trade-portal/trade-portal.src.js +++ b/plugins/plugins/core/trade-portal/trade-portal.src.js @@ -1417,7 +1417,6 @@ class TradePortal extends LitElement { } firstUpdated() { - let _this = this this.changeTheme() @@ -1505,42 +1504,42 @@ class TradePortal extends LitElement { const getQortBtcPrice = () => { parentEpml.request("apiCall", { url: `/crosschain/price/BITCOIN?inverse=true` }).then((res) => { - setTimeout(() => { this.qortbtc = (Number(res) / 1e8).toFixed(8) }, 1) + this.qortbtc = (Number(res) / 1e8).toFixed(8) }) setTimeout(getQortBtcPrice, 300000) } const getQortLtcPrice = () => { parentEpml.request("apiCall", { url: `/crosschain/price/LITECOIN?inverse=true` }).then((res) => { - setTimeout(() => { this.qortltc = (Number(res) / 1e8).toFixed(8) }, 1) + this.qortltc = (Number(res) / 1e8).toFixed(8) }) setTimeout(getQortLtcPrice, 300000) } const getQortDogePrice = () => { parentEpml.request("apiCall", { url: `/crosschain/price/DOGECOIN?inverse=true` }).then((res) => { - setTimeout(() => { this.qortdoge = (Number(res) / 1e8).toFixed(8) }, 1) + this.qortdoge = (Number(res) / 1e8).toFixed(8) }) setTimeout(getQortDogePrice, 300000) } const getQortDgbPrice = () => { parentEpml.request("apiCall", { url: `/crosschain/price/DIGIBYTE?inverse=true` }).then((res) => { - setTimeout(() => { this.qortdgb = (Number(res) / 1e8).toFixed(8) }, 1) + this.qortdgb = (Number(res) / 1e8).toFixed(8) }) setTimeout(getQortDgbPrice, 300000) } const getQortRvnPrice = () => { parentEpml.request("apiCall", { url: `/crosschain/price/RAVENCOIN?inverse=true` }).then((res) => { - setTimeout(() => { this.qortrvn = (Number(res) / 1e8).toFixed(8) }, 1) + this.qortrvn = (Number(res) / 1e8).toFixed(8) }) setTimeout(getQortRvnPrice, 300000) } const getQortArrrPrice = () => { parentEpml.request("apiCall", { url: `/crosschain/price/PIRATECHAIN?inverse=true` }).then((res) => { - setTimeout(() => { this.qortarrr = (Number(res) / 1e8).toFixed(8) }, 1) + this.qortarrr = (Number(res) / 1e8).toFixed(8) }) setTimeout(getQortArrrPrice, 300000) } @@ -1614,6 +1613,18 @@ class TradePortal extends LitElement { parentEpml.imReady() setTimeout(() => this.shadowRoot.querySelector('[slot="vaadin-grid-cell-content-3"]').setAttribute('title', 'Last Seen'), 3000) + this.clearConsole() + setInterval(() => { + this.clearConsole() + }, 60000) + } + + clearConsole() { + if (!isElectron()) { + } else { + console.clear() + window.parent.electronAPI.clearCache() + } } renderTradeLockButton() { diff --git a/plugins/plugins/core/wallet/wallet-app.src.js b/plugins/plugins/core/wallet/wallet-app.src.js index 02e4cba4..a683fc49 100644 --- a/plugins/plugins/core/wallet/wallet-app.src.js +++ b/plugins/plugins/core/wallet/wallet-app.src.js @@ -2819,7 +2819,6 @@ class MultiWallet extends LitElement { } firstUpdated() { - this.changeTheme() this.changeLanguage() @@ -2902,6 +2901,19 @@ class MultiWallet extends LitElement { window.parent.electronAPI.showMyMenu() }) } + + this.clearConsole() + setInterval(() => { + this.clearConsole() + }, 60000) + } + + clearConsole() { + if (!isElectron()) { + } else { + console.clear() + window.parent.electronAPI.clearCache() + } } renderWalletLockButton() {