From 42201341c11562b04c75c9f936e4d88bb3880b27 Mon Sep 17 00:00:00 2001 From: AlphaX-Projects <77661270+AlphaX-Projects@users.noreply.github.com> Date: Wed, 27 Mar 2024 12:48:38 +0100 Subject: [PATCH] Cleanup code --- core/src/apiKeyUtils.js | 6 +- core/src/components/app-view.js | 32 +-- .../beginner-tour/tour-component.js | 8 +- core/src/components/check-for-update.js | 2 +- .../friends-view/ChatSideNavHeads.js | 8 +- .../friends-view/add-friends-modal.js | 2 +- core/src/components/friends-view/avatar.js | 2 +- .../friends-view/beginner-checklist.js | 10 +- .../friends-view/core-sync-status.js | 4 +- core/src/components/friends-view/feed-item.js | 2 +- .../friends-view/friend-item-actions.js | 2 +- .../components/friends-view/friends-feed.js | 6 +- .../friends-view/friends-side-panel-parent.js | 2 +- .../friends-view/friends-side-panel.js | 2 +- .../components/friends-view/friends-view.js | 6 +- .../friends-view/profile-modal-update.js | 14 +- core/src/components/friends-view/profile.js | 8 +- .../friends-view/save-settings-qdn.js | 6 +- core/src/components/language-selector.js | 2 +- .../login-view/create-account-section.js | 2 +- .../components/login-view/login-section.js | 2 +- core/src/components/login-view/login-view.js | 2 +- core/src/components/login-view/particle.js | 4 +- .../src/components/login-view/welcome-page.js | 2 +- .../src/components/logout-view/logout-view.js | 2 +- core/src/components/new-selector.js | 2 +- .../notification-bell-general.js | 3 +- .../notification-view/notification-bell.js | 6 +- core/src/components/search-modal.js | 4 +- .../components/settings-view/account-view.js | 4 +- .../components/settings-view/export-keys.js | 2 +- .../settings-view/notifications-view.js | 2 +- .../components/settings-view/qr-login-view.js | 2 +- .../components/settings-view/security-view.js | 2 +- .../components/settings-view/user-settings.js | 2 +- core/src/components/show-plugin.js | 14 +- core/src/components/start-minting.js | 6 +- core/src/components/theme-toggle.js | 2 +- .../user-info-view/user-info-view.js | 2 +- core/src/custom-elements/frag-file-input.js | 2 +- .../confirm-transaction-dialog.js | 2 +- core/src/functional-components/mykey-page.js | 2 +- .../functional-components/settings-page.js | 2 +- crypto/api/decryptStoredWallet.js | 2 +- crypto/api/kdf.js | 2 +- crypto/api/wallet/validateAddress.js | 6 +- electron.js | 40 ++-- .../core/become-minter/become-minter.src.js | 2 +- .../become-minter/components/not-sponsored.js | 2 +- .../become-minter/components/yes-sponsored.js | 2 +- .../core/components/ChatGifs/ChatGifs.js | 14 +- .../components/ChatGifs/ChatGifsExplore.js | 4 +- .../core/components/ChatGroupInvites.js | 2 +- .../core/components/ChatGroupManager.js | 16 +- .../core/components/ChatGroupSettings.js | 2 +- .../core/components/ChatGroupsManagement.js | 2 +- .../core/components/ChatGroupsModal.js | 2 +- plugins/plugins/core/components/ChatImage.js | 8 +- .../plugins/core/components/ChatLeaveGroup.js | 2 +- plugins/plugins/core/components/ChatModals.js | 2 +- plugins/plugins/core/components/ChatPage.js | 24 +-- .../plugins/core/components/ChatRightPanel.js | 2 +- .../components/ChatRightPanelResources.js | 16 +- .../plugins/core/components/ChatScroller.js | 26 +-- .../core/components/ChatSeachResults.js | 2 +- .../core/components/ChatSearchResults.js | 2 +- plugins/plugins/core/components/ChatSelect.js | 6 +- .../core/components/ChatSideNavHeads.js | 6 +- .../core/components/ChatTextEditor copy.js | 10 +- .../plugins/core/components/ChatTextEditor.js | 11 +- .../core/components/ChatWelcomePage.js | 10 +- .../plugins/core/components/ImageComponent.js | 8 +- .../plugins/core/components/LevelFounder.js | 2 +- plugins/plugins/core/components/NameMenu.js | 4 +- plugins/plugins/core/components/QRCode.js | 4 +- .../plugins/core/components/ReusableImage.js | 2 +- plugins/plugins/core/components/TipUser.js | 4 +- .../plugins/core/components/TradeInfoView.js | 2 +- .../plugins/core/components/TraderInfoView.js | 2 +- .../core/components/UserInfo/UserInfo.js | 8 +- .../core/components/frag-file-input.js | 2 +- .../core/components/qortal-info-view.js | 2 +- .../time-elements/extended-time-element.js | 2 +- .../core/components/time-elements/index.js | 2 +- .../group-management/group-management.src.js | 8 +- .../core/messaging/q-chat/q-chat.src.js | 4 +- .../plugins/core/minting/minting-info.src.js | 2 +- .../name-registration.src.js | 2 +- .../core/names-market/names-market.src.js | 2 +- .../node-management/node-management.src.js | 2 +- .../core/overview-page/overview-page.src.js | 18 +- plugins/plugins/core/puzzles/puzzles.src.js | 2 +- plugins/plugins/core/q-app/q-apps.src.js | 2 +- .../plugins/core/qdn/browser/browser.src.js | 6 +- .../data-management/data-management.src.js | 2 +- .../plugins/core/qdn/publish/publish.src.js | 2 +- plugins/plugins/core/qdn/websites.src.js | 2 +- .../core/qortal-lottery/qortal-lottery.src.js | 190 +++++++++--------- .../core/reward-share/reward-share.src.js | 2 +- .../sponsorship-list/sponsorship-list.src.js | 6 +- plugins/plugins/core/streams/onNewBlock.js | 10 +- plugins/plugins/core/streams/streams.js | 2 +- .../core/trade-bot/trade-bot-portal.src.js | 6 +- .../core/trade-portal/charts/arrr-charts.js | 2 +- .../core/trade-portal/charts/btc-charts.js | 2 +- .../core/trade-portal/charts/dgb-charts.js | 2 +- .../core/trade-portal/charts/doge-charts.js | 2 +- .../core/trade-portal/charts/ltc-charts.js | 2 +- .../core/trade-portal/charts/rvn-charts.js | 2 +- .../core/trade-portal/trade-portal.src.js | 12 +- plugins/plugins/core/wallet/wallet-app.src.js | 6 +- plugins/plugins/utils/publish-image.js | 30 +-- plugins/plugins/utils/publish-modal.js | 2 +- plugins/plugins/utils/warning-modal.js | 2 +- scripts/afterPack.js | 2 +- splash/download.html | 8 +- 116 files changed, 358 insertions(+), 454 deletions(-) diff --git a/core/src/apiKeyUtils.js b/core/src/apiKeyUtils.js index 307ed6cb..e65772b0 100644 --- a/core/src/apiKeyUtils.js +++ b/core/src/apiKeyUtils.js @@ -49,8 +49,6 @@ export const testApiKey = async (apiKey) => { let testRes = await api.request(testUrl, { method: "GET" }); - if (testRes === true) { - return true; - } - return false; + return testRes === true; + } diff --git a/core/src/components/app-view.js b/core/src/components/app-view.js index 3f2b6877..07a0b84f 100644 --- a/core/src/components/app-view.js +++ b/core/src/components/app-view.js @@ -3,7 +3,7 @@ import { connect } from 'pwa-helpers' import { store } from '../store.js' import { Epml } from '../epml.js' import { addTradeBotRoutes } from '../tradebot/addTradeBotRoutes.js' -import { get, translate } from '../../translate/index.js' +import { get, translate } from '../../translate' import localForage from 'localforage' import { decryptData, encryptData } from '../lockScreen.js' import { setChatLastSeen } from '../redux/app/app-actions.js' @@ -560,7 +560,7 @@ class AppView extends connect(store)(LitElement) { if(el3) { els['checklist'] = el3 } - + return els } @@ -965,7 +965,7 @@ class AppView extends connect(store)(LitElement) { await appDelay(1000) if (this.isEmptyArray(this.tradeBotAvailableBtcQortal) === true) { - return + } else { const botbtcprice = this.round(parseFloat(this.tradeBotBtcBook[0].botBtcPrice)) const changebtcamount = parseFloat(this.tradeBotBtcBook[0].botBtcQortAmount) @@ -1009,7 +1009,7 @@ class AppView extends connect(store)(LitElement) { } if (this.isEmptyArray(this.tradeBotBtcBook) === true) { - return + } else { const checkBotBtcFunds = this.round(parseFloat(this.tradeBotBtcBook[0].botBtcQortAmount) * parseFloat(this.tradeBotBtcBook[0].botBtcPrice)) const myBotBtcFunds = this.round(parseFloat(this.btcWalletBalance)) @@ -1162,7 +1162,7 @@ class AppView extends connect(store)(LitElement) { await appDelay(1000) if (this.isEmptyArray(this.tradeBotAvailableLtcQortal) === true) { - return + } else { const botltcprice = this.round(parseFloat(this.tradeBotLtcBook[0].botLtcPrice)) const changeltcamount = parseFloat(this.tradeBotLtcBook[0].botLtcQortAmount) @@ -1206,7 +1206,7 @@ class AppView extends connect(store)(LitElement) { } if (this.isEmptyArray(this.tradeBotLtcBook) === true) { - return + } else { const checkBotLtcFunds = this.round(parseFloat(this.tradeBotLtcBook[0].botLtcQortAmount) * parseFloat(this.tradeBotLtcBook[0].botLtcPrice)) const myBotLtcFunds = this.round(parseFloat(this.ltcWalletBalance)) @@ -1348,7 +1348,7 @@ class AppView extends connect(store)(LitElement) { await appDelay(1000) if (this.isEmptyArray(this.tradeBotAvailableDogeQortal) === true) { - return + } else { const botdogeprice = this.round(parseFloat(this.tradeBotDogeBook[0].botDogePrice)) const changedogeamount = parseFloat(this.tradeBotDogeBook[0].botDogeQortAmount) @@ -1392,7 +1392,7 @@ class AppView extends connect(store)(LitElement) { } if (this.isEmptyArray(this.tradeBotDogeBook) === true) { - return + } else { const checkBotDogeFunds = this.round(parseFloat(this.tradeBotDogeBook[0].botDogeQortAmount) * parseFloat(this.tradeBotDogeBook[0].botDogePrice)) const myBotDogeFunds = this.round(parseFloat(this.dogeWalletBalance)) @@ -1534,7 +1534,7 @@ class AppView extends connect(store)(LitElement) { await appDelay(1000) if (this.isEmptyArray(this.tradeBotAvailableDgbQortal) === true) { - return + } else { const botdgbprice = this.round(parseFloat(this.tradeBotDgbBook[0].botDgbPrice)) const changedgbamount = parseFloat(this.tradeBotDgbBook[0].botDgbQortAmount) @@ -1578,7 +1578,7 @@ class AppView extends connect(store)(LitElement) { } if (this.isEmptyArray(this.tradeBotDgbBook) === true) { - return + } else { const checkBotDgbFunds = this.round(parseFloat(this.tradeBotDgbBook[0].botDgbQortAmount) * parseFloat(this.tradeBotDgbBook[0].botDgbPrice)) const myBotDgbFunds = this.round(parseFloat(this.dgbWalletBalance)) @@ -1720,7 +1720,7 @@ class AppView extends connect(store)(LitElement) { await appDelay(1000) if (this.isEmptyArray(this.tradeBotAvailableRvnQortal) === true) { - return + } else { const botrvnprice = this.round(parseFloat(this.tradeBotRvnBook[0].botRvnPrice)) const changervnamount = parseFloat(this.tradeBotRvnBook[0].botRvnQortAmount) @@ -1764,7 +1764,7 @@ class AppView extends connect(store)(LitElement) { } if (this.isEmptyArray(this.tradeBotRvnBook) === true) { - return + } else { const checkBotRvnFunds = this.round(parseFloat(this.tradeBotRvnBook[0].botRvnQortAmount) * parseFloat(this.tradeBotRvnBook[0].botRvnPrice)) const myBotRvnFunds = this.round(parseFloat(this.rvnWalletBalance)) @@ -1906,7 +1906,7 @@ class AppView extends connect(store)(LitElement) { await appDelay(1000) if (this.isEmptyArray(this.tradeBotAvailableArrrQortal) === true) { - return + } else { const botarrrprice = this.round(parseFloat(this.tradeBotArrrBook[0].botArrrPrice)) const changearrramount = parseFloat(this.tradeBotArrrBook[0].botArrrQortAmount) @@ -1950,7 +1950,7 @@ class AppView extends connect(store)(LitElement) { } if (this.isEmptyArray(this.tradeBotArrrBook) === true) { - return + } else { const checkBotArrrFunds = this.round(parseFloat(this.tradeBotArrrBook[0].botArrrQortAmount) * parseFloat(this.tradeBotArrrBook[0].botArrrPrice)) const myBotArrrFunds = this.round(parseFloat(this.arrrWalletBalance)) @@ -2243,7 +2243,7 @@ class AppView extends connect(store)(LitElement) { this.helperMessage = this.renderHelperErr() await errDelay(3000) this.helperMessage = this.renderHelperPass() - return + } } @@ -3365,4 +3365,4 @@ class AppView extends connect(store)(LitElement) { } } -window.customElements.define('app-view', AppView) \ No newline at end of file +window.customElements.define('app-view', AppView) diff --git a/core/src/components/beginner-tour/tour-component.js b/core/src/components/beginner-tour/tour-component.js index f51ba3d6..5475235a 100644 --- a/core/src/components/beginner-tour/tour-component.js +++ b/core/src/components/beginner-tour/tour-component.js @@ -5,7 +5,7 @@ import '@material/mwc-icon'; import '@polymer/paper-spinner/paper-spinner-lite.js'; import '@vaadin/tooltip'; import '@material/mwc-button'; -import { get, translate } from '../../../translate/index.js'; +import { get, translate } from '../../../translate'; import '@polymer/paper-dialog/paper-dialog.js'; import { setNewTab } from '../../redux/app/app-actions.js'; import { store } from '../../store.js'; @@ -116,7 +116,7 @@ class TourComponent extends connect(store)(LitElement) { _controlOpenWelcomeModal() { this.isSynced = true - + const seenWelcomeSync = JSON.parse( localStorage.getItem('welcome-sync') || 'false' ); @@ -280,7 +280,7 @@ class TourComponent extends connect(store)(LitElement) {

${get("tour.tour4")}

- + `, }, }); @@ -397,7 +397,7 @@ class TourComponent extends connect(store)(LitElement) { class="close-button" @click=${()=> { this.onClose() - + }} > ${translate("general.close")} diff --git a/core/src/components/check-for-update.js b/core/src/components/check-for-update.js index 10ad8339..26a9a70e 100644 --- a/core/src/components/check-for-update.js +++ b/core/src/components/check-for-update.js @@ -1,5 +1,5 @@ import {css, html, LitElement} from 'lit' -import {translate} from '../../translate/index.js' +import {translate} from '../../translate' import isElectron from 'is-electron' import '@polymer/paper-icon-button/paper-icon-button.js' diff --git a/core/src/components/friends-view/ChatSideNavHeads.js b/core/src/components/friends-view/ChatSideNavHeads.js index 66c006fb..d2f6ebdd 100644 --- a/core/src/components/friends-view/ChatSideNavHeads.js +++ b/core/src/components/friends-view/ChatSideNavHeads.js @@ -1,5 +1,5 @@ import {css, html, LitElement} from 'lit' -import {get} from '../../../translate/index.js' +import {get} from '../../../translate' import '@material/mwc-icon' import '@vaadin/tooltip'; @@ -206,11 +206,9 @@ class ChatSideNavHeads extends LitElement { if(changedProperties.has('chatInfo')){ return true } - if(changedProperties.has('isImageLoaded')){ - return true - } + return !!changedProperties.has('isImageLoaded'); + - return false } getUrl(chatUrl) { diff --git a/core/src/components/friends-view/add-friends-modal.js b/core/src/components/friends-view/add-friends-modal.js index c622e4ef..1c3412c4 100644 --- a/core/src/components/friends-view/add-friends-modal.js +++ b/core/src/components/friends-view/add-friends-modal.js @@ -1,5 +1,5 @@ import {css, html, LitElement} from 'lit'; -import {translate,} from '../../../translate/index.js' +import {translate,} from '../../../translate' import '@material/mwc-button'; import '@material/mwc-dialog'; import '@material/mwc-checkbox'; diff --git a/core/src/components/friends-view/avatar.js b/core/src/components/friends-view/avatar.js index fdee3967..5659478d 100644 --- a/core/src/components/friends-view/avatar.js +++ b/core/src/components/friends-view/avatar.js @@ -1,5 +1,5 @@ import { LitElement, html, css } from 'lit'; -import { get, translate } from '../../../translate/index.js' +import { get, translate } from '../../../translate' import axios from 'axios'; import '@material/mwc-menu'; import '@material/mwc-list/mwc-list-item.js'; diff --git a/core/src/components/friends-view/beginner-checklist.js b/core/src/components/friends-view/beginner-checklist.js index 3501d112..b942c621 100644 --- a/core/src/components/friends-view/beginner-checklist.js +++ b/core/src/components/friends-view/beginner-checklist.js @@ -8,7 +8,7 @@ import '@polymer/iron-icons/iron-icons.js'; import { store } from '../../store.js'; import { setNewTab } from '../../redux/app/app-actions.js'; import '@material/mwc-icon'; -import { get, translate } from '../../../translate/index.js'; +import { get, translate } from '../../../translate'; import { repeat } from 'lit/directives/repeat.js'; import '../../../../plugins/plugins/core/components/TimeAgo.js'; import '../notification-view/popover.js'; @@ -94,11 +94,7 @@ class BeginnerChecklist extends connect(store)(LitElement) { const res = await fetch(endpoint); const getNames = await res.json(); - if (Array.isArray(getNames) && getNames.length > 0) { - this.hasName = true; - } else { - this.hasName = false; - } + this.hasName = Array.isArray(getNames) && getNames.length > 0; } catch (error) { return ''; } @@ -132,7 +128,7 @@ class BeginnerChecklist extends connect(store)(LitElement) { state.app.accountInfo.names.length > 0 ) { this.hasName = true; - } + } } handleBlur() { diff --git a/core/src/components/friends-view/core-sync-status.js b/core/src/components/friends-view/core-sync-status.js index 733123aa..adef06ac 100644 --- a/core/src/components/friends-view/core-sync-status.js +++ b/core/src/components/friends-view/core-sync-status.js @@ -1,7 +1,7 @@ import {css, html, LitElement} from 'lit' import {store} from '../../store' import {connect} from 'pwa-helpers' -import {translate} from '../../../translate/index.js' +import {translate} from '../../../translate' class CoreSyncStatus extends connect(store)(LitElement) { static get properties() { @@ -201,4 +201,4 @@ class CoreSyncStatus extends connect(store)(LitElement) { } -customElements.define('core-sync-status', CoreSyncStatus) \ No newline at end of file +customElements.define('core-sync-status', CoreSyncStatus) diff --git a/core/src/components/friends-view/feed-item.js b/core/src/components/friends-view/feed-item.js index 4b344187..84b180c1 100644 --- a/core/src/components/friends-view/feed-item.js +++ b/core/src/components/friends-view/feed-item.js @@ -1,5 +1,5 @@ import {css, html, LitElement} from 'lit'; -import {translate,} from '../../../translate/index.js' +import {translate,} from '../../../translate' import axios from 'axios' import '@material/mwc-menu'; import '@material/mwc-list/mwc-list-item.js' diff --git a/core/src/components/friends-view/friend-item-actions.js b/core/src/components/friends-view/friend-item-actions.js index d4a2d2b0..7b5a1139 100644 --- a/core/src/components/friends-view/friend-item-actions.js +++ b/core/src/components/friends-view/friend-item-actions.js @@ -2,7 +2,7 @@ import { css, html, LitElement } from 'lit'; import { createPopper } from '@popperjs/core'; import '@material/mwc-icon'; -import { translate } from '../../../translate/index.js' +import { translate } from '../../../translate' import { store } from '../../store'; import { connect } from 'pwa-helpers'; import { setNewTab, setSideEffectAction } from '../../redux/app/app-actions'; diff --git a/core/src/components/friends-view/friends-feed.js b/core/src/components/friends-view/friends-feed.js index 6d265d6b..153fff82 100644 --- a/core/src/components/friends-view/friends-feed.js +++ b/core/src/components/friends-view/friends-feed.js @@ -5,7 +5,7 @@ import {friendsViewStyles} from './friends-view-css'; import {connect} from 'pwa-helpers'; import {store} from '../../store'; import './feed-item' -import {translate} from '../../../translate/index.js' +import {translate} from '../../../translate' import '@polymer/paper-spinner/paper-spinner-lite.js' @@ -216,7 +216,7 @@ this.getFeedOnInterval() observerHandler(entries) { if (!entries[0].isIntersecting) { - return; + } else { if (this.feedToRender.length < 20) { return; @@ -375,7 +375,7 @@ this.getFeedOnInterval() return false; }); } - + async loadAndMergeData() { let allData = this.feed diff --git a/core/src/components/friends-view/friends-side-panel-parent.js b/core/src/components/friends-view/friends-side-panel-parent.js index f763c4d1..42984e65 100644 --- a/core/src/components/friends-view/friends-side-panel-parent.js +++ b/core/src/components/friends-view/friends-side-panel-parent.js @@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit' import '@material/mwc-icon' import './friends-side-panel.js' import '@vaadin/tooltip' -import {translate} from '../../../translate/index.js' +import {translate} from '../../../translate' class FriendsSidePanelParent extends LitElement { static get properties() { diff --git a/core/src/components/friends-view/friends-side-panel.js b/core/src/components/friends-view/friends-side-panel.js index d47cc5e3..3e4a0370 100644 --- a/core/src/components/friends-view/friends-side-panel.js +++ b/core/src/components/friends-view/friends-side-panel.js @@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit'; import '@material/mwc-icon'; import './friends-view' import './friends-feed' -import {translate} from '../../../translate/index.js' +import {translate} from '../../../translate' class FriendsSidePanel extends LitElement { static get properties() { diff --git a/core/src/components/friends-view/friends-view.js b/core/src/components/friends-view/friends-view.js index 148422c9..22fb30d6 100644 --- a/core/src/components/friends-view/friends-view.js +++ b/core/src/components/friends-view/friends-view.js @@ -13,7 +13,7 @@ import './ChatSideNavHeads'; import '../../../../plugins/plugins/core/components/ChatSearchResults' import './add-friends-modal' -import {translate,} from '../../../translate/index.js' +import {translate,} from '../../../translate' import {store} from '../../store'; import {friendsViewStyles} from './friends-view-css'; import {parentEpml} from '../show-plugin'; @@ -125,7 +125,7 @@ class FriendsView extends connect(store)(LitElement) { name }; } - + this.isOpenAddFriendsModal = true this.openSidePanel() } @@ -165,7 +165,7 @@ class FriendsView extends connect(store)(LitElement) { observerHandler(entries) { if (!entries[0].isIntersecting) { - return; + } else { if (this.friendList.length < 20) { return; diff --git a/core/src/components/friends-view/profile-modal-update.js b/core/src/components/friends-view/profile-modal-update.js index bdf58755..2c6125a1 100644 --- a/core/src/components/friends-view/profile-modal-update.js +++ b/core/src/components/friends-view/profile-modal-update.js @@ -1,6 +1,6 @@ import { LitElement, html, css } from 'lit'; import { render } from 'lit/html.js'; -import { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from '../../../translate/index.js' +import { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from '../../../translate' import '@material/mwc-button'; import '@material/mwc-icon'; import '@vaadin/tooltip'; @@ -274,7 +274,7 @@ class ProfileModalUpdate extends connect(store)(LitElement) { this.requestUpdate(); } - + } async firstUpdated() { @@ -549,12 +549,12 @@ class ProfileModalUpdate extends connect(store)(LitElement) {
- +

${key} @@ -592,9 +592,9 @@ class ProfileModalUpdate extends connect(store)(LitElement) { > ${translate('general.close')} - +

- +
` : ''} - +
` } diff --git a/plugins/plugins/core/components/frag-file-input.js b/plugins/plugins/core/components/frag-file-input.js index 17744b88..3afa739c 100644 --- a/plugins/plugins/core/components/frag-file-input.js +++ b/plugins/plugins/core/components/frag-file-input.js @@ -3,7 +3,7 @@ import {css, html, LitElement} from 'lit' import '@material/mwc-button' import '@material/mwc-icon' -import {translate} from '../../../../core/translate/index.js' +import {translate} from '../../../../core/translate' class FragFileInput extends LitElement { static get properties () { diff --git a/plugins/plugins/core/components/qortal-info-view.js b/plugins/plugins/core/components/qortal-info-view.js index 9c97050b..99d3ed08 100644 --- a/plugins/plugins/core/components/qortal-info-view.js +++ b/plugins/plugins/core/components/qortal-info-view.js @@ -1,6 +1,6 @@ import {css, html, LitElement} from 'lit' import {render} from 'lit/html.js' -import {get, translate} from '../../../../core/translate/index.js' +import {get, translate} from '../../../../core/translate' import '@polymer/paper-dialog/paper-dialog.js' import '@material/mwc-button' import '@material/mwc-icon' diff --git a/plugins/plugins/core/components/time-elements/extended-time-element.js b/plugins/plugins/core/components/time-elements/extended-time-element.js index fce17b2d..874a1a89 100644 --- a/plugins/plugins/core/components/time-elements/extended-time-element.js +++ b/plugins/plugins/core/components/time-elements/extended-time-element.js @@ -75,7 +75,7 @@ export default class ExtendedTimeElement extends HTMLElement { } } getFormattedDate() { - return; + } } const titleFormatter = makeFormatter({ diff --git a/plugins/plugins/core/components/time-elements/index.js b/plugins/plugins/core/components/time-elements/index.js index 8b3dbe4c..961c29d9 100644 --- a/plugins/plugins/core/components/time-elements/index.js +++ b/plugins/plugins/core/components/time-elements/index.js @@ -240,7 +240,7 @@ class ExtendedTimeElement extends HTMLElement { } } getFormattedDate() { - return; + } } const titleFormatter = makeFormatter({ diff --git a/plugins/plugins/core/group-management/group-management.src.js b/plugins/plugins/core/group-management/group-management.src.js index e1bf5032..9c1f6300 100644 --- a/plugins/plugins/core/group-management/group-management.src.js +++ b/plugins/plugins/core/group-management/group-management.src.js @@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit' import {render} from 'lit/html.js' import {Epml} from '../../../epml.js' import isElectron from 'is-electron' -import {get, registerTranslateConfig, translate, use} from '../../../../core/translate/index.js' +import {get, registerTranslateConfig, translate, use} from '../../../../core/translate' import '../components/time-elements/index.js' import '@material/mwc-button' import '@material/mwc-dialog' @@ -2491,7 +2491,7 @@ class GroupManagement extends LitElement { }) if (this.bannedMembers.length === 0) { - return + } else { this.bannedMembers.map(a => { let callTheBannedMember = a.offender @@ -2542,7 +2542,7 @@ class GroupManagement extends LitElement { }) if (this.groupInviteMembers.length === 0) { - return + } else { this.groupInviteMembers.map(a => { let callTheInviteMember = a.invitee @@ -2589,7 +2589,7 @@ class GroupManagement extends LitElement { }) if (this.groupJoinMembers.length === 0) { - return + } else { this.groupJoinMembers.map(a => { let callTheJoinMember = a.joiner 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 86f956d4..506d7a7e 100644 --- a/plugins/plugins/core/messaging/q-chat/q-chat.src.js +++ b/plugins/plugins/core/messaging/q-chat/q-chat.src.js @@ -938,7 +938,7 @@ class Chat extends LitElement { getChatHeadFromState(chatObj) { if (chatObj === undefined) { - return + } else { this.chatHeadsObj = chatObj this.setChatHeads(chatObj) @@ -986,4 +986,4 @@ class Chat extends LitElement { } } -window.customElements.define('q-chat', Chat) \ No newline at end of file +window.customElements.define('q-chat', Chat) diff --git a/plugins/plugins/core/minting/minting-info.src.js b/plugins/plugins/core/minting/minting-info.src.js index 9790b268..c392fe06 100644 --- a/plugins/plugins/core/minting/minting-info.src.js +++ b/plugins/plugins/core/minting/minting-info.src.js @@ -1,7 +1,7 @@ import {css, html, LitElement} from 'lit' import {Epml} from '../../../epml.js' import isElectron from 'is-electron' -import {registerTranslateConfig, translate, use} from '../../../../core/translate/index.js' +import {registerTranslateConfig, translate, use} from '../../../../core/translate' import '@material/mwc-icon' import '@material/mwc-button' import '@material/mwc-dialog' diff --git a/plugins/plugins/core/name-registration/name-registration.src.js b/plugins/plugins/core/name-registration/name-registration.src.js index 69aac944..b91c8901 100644 --- a/plugins/plugins/core/name-registration/name-registration.src.js +++ b/plugins/plugins/core/name-registration/name-registration.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 '../../../../core/translate' import isElectron from 'is-electron' import '@material/mwc-button' import '@material/mwc-dialog' diff --git a/plugins/plugins/core/names-market/names-market.src.js b/plugins/plugins/core/names-market/names-market.src.js index c23f0f9a..dfe7dbfb 100644 --- a/plugins/plugins/core/names-market/names-market.src.js +++ b/plugins/plugins/core/names-market/names-market.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 '../../../../core/translate' import isElectron from 'is-electron' import '../components/qortal-info-view.js' import '@material/mwc-button' diff --git a/plugins/plugins/core/node-management/node-management.src.js b/plugins/plugins/core/node-management/node-management.src.js index 3716c024..f1740123 100644 --- a/plugins/plugins/core/node-management/node-management.src.js +++ b/plugins/plugins/core/node-management/node-management.src.js @@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit' import {render} from 'lit/html.js' import {Epml} from '../../../epml.js' import isElectron from 'is-electron' -import {get, registerTranslateConfig, translate, use} from '../../../../core/translate/index.js' +import {get, registerTranslateConfig, translate, use} from '../../../../core/translate' import '@polymer/paper-spinner/paper-spinner-lite.js' import '@material/mwc-icon' import '@material/mwc-textfield' diff --git a/plugins/plugins/core/overview-page/overview-page.src.js b/plugins/plugins/core/overview-page/overview-page.src.js index 6592a09f..bcb87967 100644 --- a/plugins/plugins/core/overview-page/overview-page.src.js +++ b/plugins/plugins/core/overview-page/overview-page.src.js @@ -1,6 +1,6 @@ import {css, html, LitElement} from 'lit' import {Epml} from '../../../epml.js' -import {get, registerTranslateConfig, translate, use} from '../../../../core/translate/index.js' +import {get, registerTranslateConfig, translate, use} from '../../../../core/translate' import {overviewStyle} from './overview-page-css.js' import {asyncReplace} from 'lit/directives/async-replace.js' import isElectron from 'is-electron' @@ -247,17 +247,9 @@ class OverviewPage extends LitElement { const findMyMintingRecipient = this.listAccounts.find((myKey) => myKey.recipientAccount === address) const findRemovedSponsorsKey = this.listAccounts.filter((my) => my.address) - if (findMyMintingAccount === undefined) { - this.check1 = false - } else { - this.check1 = true - } + this.check1 = findMyMintingAccount !== undefined; - if (findMyMintingRecipient === undefined) { - this.check2 = false - } else { - this.check2 = true - } + this.check2 = findMyMintingRecipient !== undefined; if (findRemovedSponsorsKey.length > 0) { this.removeBlankKey(findRemovedSponsorsKey.publicKey) @@ -611,7 +603,7 @@ class StartMintingNow extends LitElement { this.getMintingAcccounts() } catch (error) { this.errorMsg = this.renderErrorMsg3() - return + } } @@ -732,7 +724,7 @@ class StartMintingNow extends LitElement { this.confirmRelationship(publicAddress) } catch (error) { this.errorMsg = error.data.message || this.renderErrorMsg4() - return + } } diff --git a/plugins/plugins/core/puzzles/puzzles.src.js b/plugins/plugins/core/puzzles/puzzles.src.js index d979bb0f..160de050 100644 --- a/plugins/plugins/core/puzzles/puzzles.src.js +++ b/plugins/plugins/core/puzzles/puzzles.src.js @@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit' import {render} from 'lit/html.js' import {Epml} from '../../../epml.js' import isElectron from 'is-electron' -import {registerTranslateConfig, translate, use} from '../../../../core/translate/index.js' +import {registerTranslateConfig, translate, use} from '../../../../core/translate' import nacl from '../../../../crypto/api/deps/nacl-fast.js' import Base58 from '../../../../crypto/api/deps/Base58.js' import publicKeyToAddress from '../../../../crypto/api/wallet/publicKeyToAddress.js' diff --git a/plugins/plugins/core/q-app/q-apps.src.js b/plugins/plugins/core/q-app/q-apps.src.js index 64241b73..594e5523 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 '../../../../core/translate' import isElectron from 'is-electron' import '@polymer/paper-spinner/paper-spinner-lite.js' import '@polymer/paper-dialog/paper-dialog.js' diff --git a/plugins/plugins/core/qdn/browser/browser.src.js b/plugins/plugins/core/qdn/browser/browser.src.js index c1701d82..319f6958 100644 --- a/plugins/plugins/core/qdn/browser/browser.src.js +++ b/plugins/plugins/core/qdn/browser/browser.src.js @@ -1,7 +1,7 @@ import { css, html, LitElement } from 'lit' import { Epml } from '../../../../epml' import isElectron from 'is-electron' -import { get, registerTranslateConfig, translate, use } from '../../../../../core/translate/index.js' +import { get, registerTranslateConfig, translate, use } from '../../../../../core/translate' import ShortUniqueId from 'short-unique-id'; import FileSaver from 'file-saver' import * as actions from '../../components/qdn-action-types' @@ -1547,7 +1547,6 @@ class WebBrowser extends LitElement { reason: errorMsg, identifier: resource.identifier }) - continue } } catch (error) { @@ -1555,7 +1554,6 @@ class WebBrowser extends LitElement { reason: "Unknown error", identifier: resource.identifier }) - continue } @@ -4164,7 +4162,7 @@ async function showModalAndWait(type, data) { const modalContent = modal.querySelector('.modal-content') modalContent.addEventListener('click', (e) => { e.stopPropagation() - return + }) const backdropClick = document.getElementById('backdrop') backdropClick.addEventListener('click', () => { 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 9a9a6f2a..64ea7202 100644 --- a/plugins/plugins/core/qdn/data-management/data-management.src.js +++ b/plugins/plugins/core/qdn/data-management/data-management.src.js @@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit' import {render} from 'lit/html.js' import {Epml} from '../../../../epml' import isElectron from 'is-electron' -import {get, registerTranslateConfig, translate, use} from '../../../../../core/translate/index.js' +import {get, registerTranslateConfig, translate, use} from '../../../../../core/translate' import '@material/mwc-button' import '@material/mwc-dialog' import '@material/mwc-icon' diff --git a/plugins/plugins/core/qdn/publish/publish.src.js b/plugins/plugins/core/qdn/publish/publish.src.js index fa3fd9c9..3e69cc74 100644 --- a/plugins/plugins/core/qdn/publish/publish.src.js +++ b/plugins/plugins/core/qdn/publish/publish.src.js @@ -1,7 +1,7 @@ import {css, html, LitElement} from 'lit' import {Epml} from '../../../../epml' import isElectron from 'is-electron' -import {get, registerTranslateConfig, translate, use} from '../../../../../core/translate/index.js' +import {get, registerTranslateConfig, translate, use} from '../../../../../core/translate' import '@material/mwc-button' import '@material/mwc-textfield' import '@material/mwc-select' diff --git a/plugins/plugins/core/qdn/websites.src.js b/plugins/plugins/core/qdn/websites.src.js index 2881dd63..03c84627 100644 --- a/plugins/plugins/core/qdn/websites.src.js +++ b/plugins/plugins/core/qdn/websites.src.js @@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit' import {render} from 'lit/html.js' import {Epml} from '../../../epml.js' import isElectron from 'is-electron' -import {get, registerTranslateConfig, translate, use} from '../../../../core/translate/index.js' +import {get, registerTranslateConfig, translate, use} from '../../../../core/translate' import '@material/mwc-dialog' import '@material/mwc-icon' import '@material/mwc-button' diff --git a/plugins/plugins/core/qortal-lottery/qortal-lottery.src.js b/plugins/plugins/core/qortal-lottery/qortal-lottery.src.js index 0859f509..149ffe14 100644 --- a/plugins/plugins/core/qortal-lottery/qortal-lottery.src.js +++ b/plugins/plugins/core/qortal-lottery/qortal-lottery.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 '../../../../core/translate' import isElectron from 'is-electron' import '@material/mwc-button' import '@material/mwc-dialog' @@ -480,20 +480,20 @@ class QortalLottery extends LitElement { }) }) - await this.openLotteries.map(item => { - const aTT = item.ATAddress - const endHeight = item.sleepUntilHeight - const newObj = { - ATAddress: aTT, - sleepUntilHeight: endHeight - } - this.openLotteriesAtArray.push(newObj) - }) - - await this.closedLotteries.map(item => { - const myAT = item.ATAddress - this.closedLotteriesAtArray.push(myAT) - }) + this.openLotteries.map(item => { + const aTT = item.ATAddress + const endHeight = item.sleepUntilHeight + const newObj = { + ATAddress: aTT, + sleepUntilHeight: endHeight + } + this.openLotteriesAtArray.push(newObj) + }) + + this.closedLotteries.map(item => { + const myAT = item.ATAddress + this.closedLotteriesAtArray.push(myAT) + }) const appDelay = ms => new Promise(res => setTimeout(res, ms)) await appDelay(1000) @@ -502,37 +502,37 @@ class QortalLottery extends LitElement { async getOpenLotteries() { let prepareOpenLotteriesArray = [] - await this.openLotteriesAtArray.map(item => { - parentEpml.request('apiCall', { - url: `/transactions/address/${item.ATAddress}?limit=0&reverse=true` - }).then(res => { - this.openLotteriesFilterTx1 = [] - this.openLotteriesFilterTx2 = [] - this.openLotteriesFilterTx = res.filter(function (da) { - return da.type === "DEPLOY_AT" - }) - this.openLotteriesFilterTx2 = res.filter(function (pm) { - return pm.type === "PAYMENT" - }) - this.openLotteriesFilterTx.map(item2 => { - const sleep = item.sleepUntilHeight - const desc = item2.description - const start = item2.blockHeight - const ata = item2.aTAddress - const amount = item2.tags - const players = this.openLotteriesFilterTx2.length - const obj = { - description: desc, - startBlock: start, - endBlock: sleep, - aTAddress: ata, - joined: players, - enter: amount - } - prepareOpenLotteriesArray.push(obj) - }) - }) - }) + this.openLotteriesAtArray.map(item => { + parentEpml.request('apiCall', { + url: `/transactions/address/${item.ATAddress}?limit=0&reverse=true` + }).then(res => { + this.openLotteriesFilterTx1 = [] + this.openLotteriesFilterTx2 = [] + this.openLotteriesFilterTx = res.filter(function (da) { + return da.type === "DEPLOY_AT" + }) + this.openLotteriesFilterTx2 = res.filter(function (pm) { + return pm.type === "PAYMENT" + }) + this.openLotteriesFilterTx.map(item2 => { + const sleep = item.sleepUntilHeight + const desc = item2.description + const start = item2.blockHeight + const ata = item2.aTAddress + const amount = item2.tags + const players = this.openLotteriesFilterTx2.length + const obj = { + description: desc, + startBlock: start, + endBlock: sleep, + aTAddress: ata, + joined: players, + enter: amount + } + prepareOpenLotteriesArray.push(obj) + }) + }) + }) const appDelay = ms => new Promise(res => setTimeout(res, ms)) await appDelay(2000) this.openLotteriesArray = prepareOpenLotteriesArray @@ -543,55 +543,55 @@ class QortalLottery extends LitElement { async getFinishedLotteries() { let prepareClosedLotteriesArray = [] - await this.closedLotteriesAtArray.map(item => { - parentEpml.request('apiCall', { - url: `/transactions/address/${item}?limit=0&reverse=true` - }).then(res => { - this.closedLotteriesFilterTx1 = [] - this.closedLotteriesFilterTx2 = [] - this.closedLotteriesFilterTx1 = res.filter(function (el) { - return el.type === "DEPLOY_AT" - }) - this.closedLotteriesFilterTx2 = res.filter(function (el) { - return el.type === "AT" - }) - - this.closedLotteriesFilterTx2.map(item1 => { - const twinner = item1.recipient - const tjackpot = item1.amount - const tendblock = item1.blockHeight - this.closedLotteriesFilterTx1.map(item2 => { - const tstartblock = item2.blockHeight - const tdescription = item2.description - parentEpml.request('apiCall', { - url: `/names/address/${twinner}?limit=0&reverse=true` - }).then(res => { - if (res.length) { - const winName = res[0].name - const obj = { - description: tdescription, - startblock: tstartblock, - endblock: tendblock, - winner: winName, - jackpot: tjackpot - } - prepareClosedLotteriesArray.push(obj) - } else { - const winName = twinner - const obj = { - description: tdescription, - startblock: tstartblock, - endblock: tendblock, - winner: winName, - jackpot: tjackpot - } - prepareClosedLotteriesArray.push(obj) - } - }) - }) - }) - }) - }) + this.closedLotteriesAtArray.map(item => { + parentEpml.request('apiCall', { + url: `/transactions/address/${item}?limit=0&reverse=true` + }).then(res => { + this.closedLotteriesFilterTx1 = [] + this.closedLotteriesFilterTx2 = [] + this.closedLotteriesFilterTx1 = res.filter(function (el) { + return el.type === "DEPLOY_AT" + }) + this.closedLotteriesFilterTx2 = res.filter(function (el) { + return el.type === "AT" + }) + + this.closedLotteriesFilterTx2.map(item1 => { + const twinner = item1.recipient + const tjackpot = item1.amount + const tendblock = item1.blockHeight + this.closedLotteriesFilterTx1.map(item2 => { + const tstartblock = item2.blockHeight + const tdescription = item2.description + parentEpml.request('apiCall', { + url: `/names/address/${twinner}?limit=0&reverse=true` + }).then(res => { + if (res.length) { + const winName = res[0].name + const obj = { + description: tdescription, + startblock: tstartblock, + endblock: tendblock, + winner: winName, + jackpot: tjackpot + } + prepareClosedLotteriesArray.push(obj) + } else { + const winName = twinner + const obj = { + description: tdescription, + startblock: tstartblock, + endblock: tendblock, + winner: winName, + jackpot: tjackpot + } + prepareClosedLotteriesArray.push(obj) + } + }) + }) + }) + }) + }) const appDelay = ms => new Promise(res => setTimeout(res, ms)) await appDelay(5000) this.closedLotteriesArray = prepareClosedLotteriesArray diff --git a/plugins/plugins/core/reward-share/reward-share.src.js b/plugins/plugins/core/reward-share/reward-share.src.js index c58151b7..8613d5e9 100644 --- a/plugins/plugins/core/reward-share/reward-share.src.js +++ b/plugins/plugins/core/reward-share/reward-share.src.js @@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit' import {render} from 'lit/html.js' import {Epml} from '../../../epml.js' import isElectron from 'is-electron' -import {get, registerTranslateConfig, translate, use} from '../../../../core/translate/index.js' +import {get, registerTranslateConfig, translate, use} from '../../../../core/translate' import '@material/mwc-icon' import '@material/mwc-button' import '@material/mwc-textfield' diff --git a/plugins/plugins/core/sponsorship-list/sponsorship-list.src.js b/plugins/plugins/core/sponsorship-list/sponsorship-list.src.js index 8c940407..56ba7589 100644 --- a/plugins/plugins/core/sponsorship-list/sponsorship-list.src.js +++ b/plugins/plugins/core/sponsorship-list/sponsorship-list.src.js @@ -1,6 +1,6 @@ import {html, LitElement} from 'lit' import {Epml} from '../../../epml.js' -import {get, registerTranslateConfig, translate, use} from '../../../../core/translate/index.js' +import {get, registerTranslateConfig, translate, use} from '../../../../core/translate' import {blocksNeed} from '../../utils/blocks-needed.js' import {asyncReplace} from 'lit/directives/async-replace.js' import {pageStyles} from './sponsorship-list-css.src.js' @@ -721,13 +721,13 @@ class SponsorshipList extends LitElement { } const getTxnRequestResponse = (txnResponse) => { - + const extraData = txnResponse && txnResponse.extraData; const data = txnResponse && txnResponse.data; const dataMessage = data && data.message; const extraDataPrivateKey = extraData && extraData.rewardSharePrivateKey; const txnSuccess = txnResponse && txnResponse.success; - + if (extraDataPrivateKey && typeof dataMessage === 'string' && (dataMessage.includes('multiple') || dataMessage.includes('SELF_SHARE_EXISTS'))) { this.privateRewardShareKey = extraDataPrivateKey; diff --git a/plugins/plugins/core/streams/onNewBlock.js b/plugins/plugins/core/streams/onNewBlock.js index da3ce393..70b4068d 100644 --- a/plugins/plugins/core/streams/onNewBlock.js +++ b/plugins/plugins/core/streams/onNewBlock.js @@ -19,11 +19,7 @@ let blockSocketReconnectInterval = MIN_RECONNECT_INTERVAL; let nodeStatusSocketReconnectInterval = MIN_RECONNECT_INTERVAL; parentEpml.subscribe('logged_in', loggedIn => { - if (loggedIn === 'true') { - isLoggedIn = true - } else { - isLoggedIn = false - } + isLoggedIn = loggedIn === 'true'; }) @@ -39,7 +35,7 @@ const setAccountInfo = async (addr) => { addressInfo: addressInfo } if (window.parent._.isEqual(oldAccountInfo, accountInfo) === true) { - return + } else { parentEpml.request('setAccountInfo', accountInfo) oldAccountInfo = accountInfo @@ -82,7 +78,7 @@ export const startConfigWatcher = () => { let _newState = JSON.parse(c) let newState = { node: _newState.node, knownNodes: _newState.knownNodes } if (window.parent._.isEqual(oldState, newState) === true) { - return + } else { oldState = newState nodeStateCall = true diff --git a/plugins/plugins/core/streams/streams.js b/plugins/plugins/core/streams/streams.js index 48d91546..fc4d9f71 100644 --- a/plugins/plugins/core/streams/streams.js +++ b/plugins/plugins/core/streams/streams.js @@ -36,7 +36,7 @@ const sortActiveChat = (activeChatObject, localChatHeads) => { let oldChatHeads = JSON.parse(localChatHeads) if (window.parent._.isEqual(oldChatHeads, activeChatObject) === true) { - return + } else { let oldActiveChats = objectToArray(oldChatHeads) 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 e16e50c6..e33c3774 100644 --- a/plugins/plugins/core/trade-bot/trade-bot-portal.src.js +++ b/plugins/plugins/core/trade-bot/trade-bot-portal.src.js @@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit' import {render} from 'lit/html.js' import {Epml} from '../../../epml.js' import isElectron from 'is-electron' -import {get, registerTranslateConfig, translate, use} from '../../../../core/translate/index.js' +import {get, registerTranslateConfig, translate, use} from '../../../../core/translate' import Base58 from '../../../../crypto/api/deps/Base58.js' import {decryptData, encryptData} from '../../../../core/src/lockScreen.js' import {tradebotStyles} from './trade-bot-portal-css.js' @@ -1830,7 +1830,7 @@ class TradeBotPortal extends LitElement { this.autoHelperMessage = this.renderAutoHelperErr() await errDelay(3000) this.autoHelperMessage = this.renderAutoHelperPass() - return + } } @@ -3314,4 +3314,4 @@ class TradeBotPortal extends LitElement { } } -window.customElements.define('trade-bot-portal', TradeBotPortal) \ No newline at end of file +window.customElements.define('trade-bot-portal', TradeBotPortal) diff --git a/plugins/plugins/core/trade-portal/charts/arrr-charts.js b/plugins/plugins/core/trade-portal/charts/arrr-charts.js index 1389cda5..8ee8b7e5 100644 --- a/plugins/plugins/core/trade-portal/charts/arrr-charts.js +++ b/plugins/plugins/core/trade-portal/charts/arrr-charts.js @@ -1,6 +1,6 @@ import {css, html, LitElement} from 'lit' import {Epml} from '../../../../epml.js' -import {get, registerTranslateConfig, translate, use} from '../../../../../core/translate/index.js' +import {get, registerTranslateConfig, translate, use} from '../../../../../core/translate' import '@polymer/paper-dialog/paper-dialog.js' import * as Highcharts from 'highcharts' import Exporting from 'highcharts/modules/exporting' diff --git a/plugins/plugins/core/trade-portal/charts/btc-charts.js b/plugins/plugins/core/trade-portal/charts/btc-charts.js index a72d19b1..1ab350e2 100644 --- a/plugins/plugins/core/trade-portal/charts/btc-charts.js +++ b/plugins/plugins/core/trade-portal/charts/btc-charts.js @@ -1,6 +1,6 @@ import {css, html, LitElement} from 'lit' import {Epml} from '../../../../epml.js' -import {get, registerTranslateConfig, translate, use} from '../../../../../core/translate/index.js' +import {get, registerTranslateConfig, translate, use} from '../../../../../core/translate' import '@polymer/paper-dialog/paper-dialog.js' import * as Highcharts from 'highcharts' import Exporting from 'highcharts/modules/exporting' diff --git a/plugins/plugins/core/trade-portal/charts/dgb-charts.js b/plugins/plugins/core/trade-portal/charts/dgb-charts.js index 42da663a..369887f7 100644 --- a/plugins/plugins/core/trade-portal/charts/dgb-charts.js +++ b/plugins/plugins/core/trade-portal/charts/dgb-charts.js @@ -1,6 +1,6 @@ import {css, html, LitElement} from 'lit' import {Epml} from '../../../../epml.js' -import {get, registerTranslateConfig, translate, use} from '../../../../../core/translate/index.js' +import {get, registerTranslateConfig, translate, use} from '../../../../../core/translate' import '@polymer/paper-dialog/paper-dialog.js' import * as Highcharts from 'highcharts' import Exporting from 'highcharts/modules/exporting' diff --git a/plugins/plugins/core/trade-portal/charts/doge-charts.js b/plugins/plugins/core/trade-portal/charts/doge-charts.js index 54c3cdb2..acd95eb4 100644 --- a/plugins/plugins/core/trade-portal/charts/doge-charts.js +++ b/plugins/plugins/core/trade-portal/charts/doge-charts.js @@ -1,6 +1,6 @@ import {css, html, LitElement} from 'lit' import {Epml} from '../../../../epml.js' -import {get, registerTranslateConfig, translate, use} from '../../../../../core/translate/index.js' +import {get, registerTranslateConfig, translate, use} from '../../../../../core/translate' import '@polymer/paper-dialog/paper-dialog.js' import * as Highcharts from 'highcharts' import Exporting from 'highcharts/modules/exporting' diff --git a/plugins/plugins/core/trade-portal/charts/ltc-charts.js b/plugins/plugins/core/trade-portal/charts/ltc-charts.js index 1d6d9ab3..d4f3ec71 100644 --- a/plugins/plugins/core/trade-portal/charts/ltc-charts.js +++ b/plugins/plugins/core/trade-portal/charts/ltc-charts.js @@ -1,6 +1,6 @@ import {css, html, LitElement} from 'lit' import {Epml} from '../../../../epml.js' -import {get, registerTranslateConfig, translate, use} from '../../../../../core/translate/index.js' +import {get, registerTranslateConfig, translate, use} from '../../../../../core/translate' import '@polymer/paper-dialog/paper-dialog.js' import * as Highcharts from 'highcharts' import Exporting from 'highcharts/modules/exporting' diff --git a/plugins/plugins/core/trade-portal/charts/rvn-charts.js b/plugins/plugins/core/trade-portal/charts/rvn-charts.js index 032de088..8fea7944 100644 --- a/plugins/plugins/core/trade-portal/charts/rvn-charts.js +++ b/plugins/plugins/core/trade-portal/charts/rvn-charts.js @@ -1,6 +1,6 @@ import {css, html, LitElement} from 'lit' import {Epml} from '../../../../epml.js' -import {get, registerTranslateConfig, translate, use} from '../../../../../core/translate/index.js' +import {get, registerTranslateConfig, translate, use} from '../../../../../core/translate' import '@polymer/paper-dialog/paper-dialog.js' import * as Highcharts from 'highcharts' import Exporting from 'highcharts/modules/exporting' diff --git a/plugins/plugins/core/trade-portal/trade-portal.src.js b/plugins/plugins/core/trade-portal/trade-portal.src.js index de0c8980..e8a99668 100644 --- a/plugins/plugins/core/trade-portal/trade-portal.src.js +++ b/plugins/plugins/core/trade-portal/trade-portal.src.js @@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit' import {render} from 'lit/html.js' import {Epml} from '../../../epml.js' import isElectron from 'is-electron' -import {get, registerTranslateConfig, translate, use} from '../../../../core/translate/index.js' +import {get, registerTranslateConfig, translate, use} from '../../../../core/translate' import Base58 from '../../../../crypto/api/deps/Base58.js' import {decryptData, encryptData} from '../../../../core/src/lockScreen.js' import {tradeStyles} from './trade-portal-css.js' @@ -953,11 +953,7 @@ class TradePortal extends LitElement { const getSellButtonStatus = () => { if (this.nodeInfo.isSynchronizing === true) { this.sellBtnDisable = true - } else if (this.nodeInfo.isSynchronizing === false) { - this.sellBtnDisable = false - } else { - this.sellBtnDisable = true - } + } else this.sellBtnDisable = this.nodeInfo.isSynchronizing !== false; } const getQortBtcPrice = () => { @@ -1244,7 +1240,7 @@ class TradePortal extends LitElement { this.tradeHelperMessage = this.renderTradeHelperErr() await errDelay(3000) this.tradeHelperMessage = this.renderTradeHelperPass() - return + } } @@ -2833,4 +2829,4 @@ class TradePortal extends LitElement { } } -window.customElements.define('trade-portal', TradePortal) \ No newline at end of file +window.customElements.define('trade-portal', TradePortal) diff --git a/plugins/plugins/core/wallet/wallet-app.src.js b/plugins/plugins/core/wallet/wallet-app.src.js index 78d638fc..0a9916b9 100644 --- a/plugins/plugins/core/wallet/wallet-app.src.js +++ b/plugins/plugins/core/wallet/wallet-app.src.js @@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit' import {render} from 'lit/html.js' import {Epml} from '../../../epml.js' import isElectron from 'is-electron' -import {get, registerTranslateConfig, translate, use} from '../../../../core/translate/index.js' +import {get, registerTranslateConfig, translate, use} from '../../../../core/translate' import Base58 from '../../../../crypto/api/deps/Base58.js' import {decryptData, encryptData} from '../../../../core/src/lockScreen.js' import FileSaver from 'file-saver' @@ -2955,7 +2955,7 @@ class MultiWallet extends LitElement { this.walletHelperMessage = this.renderWalletHelperErr() await errDelay(3000) this.walletHelperMessage = this.renderWalletHelperPass() - return + } } @@ -4766,7 +4766,7 @@ class MultiWallet extends LitElement { await new Promise(resolve => setTimeout(resolve, 2000)) this.showWallet() return - } else if (res !== null && res !== "Synchronized") { + } else if (res !== "Synchronized") { this.balanceString = res await new Promise(resolve => setTimeout(resolve, 2000)) this.showWallet() diff --git a/plugins/plugins/utils/publish-image.js b/plugins/plugins/utils/publish-image.js index ed3b2c34..15af8a68 100644 --- a/plugins/plugins/utils/publish-image.js +++ b/plugins/plugins/utils/publish-image.js @@ -74,20 +74,20 @@ export const publishData = async ({ let nonce = null const computPath =window.parent.location.origin + '/memory-pow/memory-pow.wasm.full' await new Promise((res, rej) => { - + worker.postMessage({convertedBytes, path: computPath}); - + worker.onmessage = e => { - + worker.terminate() - + nonce = e.data.nonce res() - + } }) - - + + let response = await parentEpml.request("sign_arbitrary", { nonce: selectedAddress.nonce, arbitraryBytesBase58: transactionBytesBase58, @@ -113,9 +113,9 @@ export const publishData = async ({ throw new Error('Error when signing'); } - - - + + + let response = await parentEpml.request("sign_arbitrary_with_fee", { nonce: selectedAddress.nonce, arbitraryBytesBase58: transactionBytesBase58, @@ -194,11 +194,11 @@ export const publishData = async ({ let fileBuffer = new Uint8Array(await file.arrayBuffer()) postBody = Buffer.from(fileBuffer).toString("base64") } - + } - + let uploadDataUrl = `/arbitrary/${service}/${registeredName}${urlSuffix}?apiKey=${getApiKey()}` - if (identifier != null && identifier.trim().length > 0) { + if (identifier.trim().length > 0) { uploadDataUrl = `/arbitrary/${service}/${registeredName}/${identifier}${urlSuffix}?apiKey=${getApiKey()}` } @@ -234,7 +234,7 @@ export const publishData = async ({ if(tag5 != null && tag5 != "undefined"){ uploadDataUrl = uploadDataUrl + '&tags=' + encodeURIComponent(tag5) } - + let uploadDataRes = await parentEpml.request("apiCall", { type: "api", method: "POST", @@ -250,5 +250,5 @@ export const publishData = async ({ } catch (error) { throw new Error(error.message) } - + } diff --git a/plugins/plugins/utils/publish-modal.js b/plugins/plugins/utils/publish-modal.js index 54ea0ca4..76c60f67 100644 --- a/plugins/plugins/utils/publish-modal.js +++ b/plugins/plugins/utils/publish-modal.js @@ -1,4 +1,4 @@ -import {get} from '../../../core/translate/index.js' +import {get} from '../../../core/translate' export class ModalHelper { constructor() { diff --git a/plugins/plugins/utils/warning-modal.js b/plugins/plugins/utils/warning-modal.js index 45e78210..0399591f 100644 --- a/plugins/plugins/utils/warning-modal.js +++ b/plugins/plugins/utils/warning-modal.js @@ -1,4 +1,4 @@ -import {get} from '../../../core/translate/index.js' +import {get} from '../../../core/translate' export class WarningModal { constructor() { diff --git a/scripts/afterPack.js b/scripts/afterPack.js index 747e06db..73bda2a0 100644 --- a/scripts/afterPack.js +++ b/scripts/afterPack.js @@ -37,7 +37,7 @@ async function afterPack(context) { if (electronPlatformName.includes("linux")) { await doLinux(context); - return; + } } diff --git a/splash/download.html b/splash/download.html index f336d22d..e6608ad9 100644 --- a/splash/download.html +++ b/splash/download.html @@ -12,7 +12,7 @@ .center { margin-top: 50%; transform: translateY(-50%); - width auto; + width: auto; height: auto; overflow: hidden; } @@ -28,8 +28,8 @@ } @-webkit-keyframes spin { - 0% { -webkit-transform: rotate(0deg); } - 100% { -webkit-transform: rotate(360deg); } + 0% { --webkit-transform: rotate(0deg); } + 100% { --webkit-transform: rotate(360deg); } } @keyframes spin { @@ -49,4 +49,4 @@
- \ No newline at end of file +