Browse Source

Cleanup code

master
AlphaX-Projects 6 months ago
parent
commit
42201341c1
  1. 6
      core/src/apiKeyUtils.js
  2. 32
      core/src/components/app-view.js
  3. 8
      core/src/components/beginner-tour/tour-component.js
  4. 2
      core/src/components/check-for-update.js
  5. 8
      core/src/components/friends-view/ChatSideNavHeads.js
  6. 2
      core/src/components/friends-view/add-friends-modal.js
  7. 2
      core/src/components/friends-view/avatar.js
  8. 10
      core/src/components/friends-view/beginner-checklist.js
  9. 4
      core/src/components/friends-view/core-sync-status.js
  10. 2
      core/src/components/friends-view/feed-item.js
  11. 2
      core/src/components/friends-view/friend-item-actions.js
  12. 6
      core/src/components/friends-view/friends-feed.js
  13. 2
      core/src/components/friends-view/friends-side-panel-parent.js
  14. 2
      core/src/components/friends-view/friends-side-panel.js
  15. 6
      core/src/components/friends-view/friends-view.js
  16. 14
      core/src/components/friends-view/profile-modal-update.js
  17. 8
      core/src/components/friends-view/profile.js
  18. 6
      core/src/components/friends-view/save-settings-qdn.js
  19. 2
      core/src/components/language-selector.js
  20. 2
      core/src/components/login-view/create-account-section.js
  21. 2
      core/src/components/login-view/login-section.js
  22. 2
      core/src/components/login-view/login-view.js
  23. 4
      core/src/components/login-view/particle.js
  24. 2
      core/src/components/login-view/welcome-page.js
  25. 2
      core/src/components/logout-view/logout-view.js
  26. 2
      core/src/components/new-selector.js
  27. 3
      core/src/components/notification-view/notification-bell-general.js
  28. 6
      core/src/components/notification-view/notification-bell.js
  29. 4
      core/src/components/search-modal.js
  30. 4
      core/src/components/settings-view/account-view.js
  31. 2
      core/src/components/settings-view/export-keys.js
  32. 2
      core/src/components/settings-view/notifications-view.js
  33. 2
      core/src/components/settings-view/qr-login-view.js
  34. 2
      core/src/components/settings-view/security-view.js
  35. 2
      core/src/components/settings-view/user-settings.js
  36. 14
      core/src/components/show-plugin.js
  37. 6
      core/src/components/start-minting.js
  38. 2
      core/src/components/theme-toggle.js
  39. 2
      core/src/components/user-info-view/user-info-view.js
  40. 2
      core/src/custom-elements/frag-file-input.js
  41. 2
      core/src/functional-components/confirm-transaction-dialog.js
  42. 2
      core/src/functional-components/mykey-page.js
  43. 2
      core/src/functional-components/settings-page.js
  44. 2
      crypto/api/decryptStoredWallet.js
  45. 2
      crypto/api/kdf.js
  46. 6
      crypto/api/wallet/validateAddress.js
  47. 40
      electron.js
  48. 2
      plugins/plugins/core/become-minter/become-minter.src.js
  49. 2
      plugins/plugins/core/become-minter/components/not-sponsored.js
  50. 2
      plugins/plugins/core/become-minter/components/yes-sponsored.js
  51. 14
      plugins/plugins/core/components/ChatGifs/ChatGifs.js
  52. 4
      plugins/plugins/core/components/ChatGifs/ChatGifsExplore.js
  53. 2
      plugins/plugins/core/components/ChatGroupInvites.js
  54. 16
      plugins/plugins/core/components/ChatGroupManager.js
  55. 2
      plugins/plugins/core/components/ChatGroupSettings.js
  56. 2
      plugins/plugins/core/components/ChatGroupsManagement.js
  57. 2
      plugins/plugins/core/components/ChatGroupsModal.js
  58. 8
      plugins/plugins/core/components/ChatImage.js
  59. 2
      plugins/plugins/core/components/ChatLeaveGroup.js
  60. 2
      plugins/plugins/core/components/ChatModals.js
  61. 24
      plugins/plugins/core/components/ChatPage.js
  62. 2
      plugins/plugins/core/components/ChatRightPanel.js
  63. 16
      plugins/plugins/core/components/ChatRightPanelResources.js
  64. 26
      plugins/plugins/core/components/ChatScroller.js
  65. 2
      plugins/plugins/core/components/ChatSeachResults.js
  66. 2
      plugins/plugins/core/components/ChatSearchResults.js
  67. 6
      plugins/plugins/core/components/ChatSelect.js
  68. 6
      plugins/plugins/core/components/ChatSideNavHeads.js
  69. 10
      plugins/plugins/core/components/ChatTextEditor copy.js
  70. 11
      plugins/plugins/core/components/ChatTextEditor.js
  71. 10
      plugins/plugins/core/components/ChatWelcomePage.js
  72. 8
      plugins/plugins/core/components/ImageComponent.js
  73. 2
      plugins/plugins/core/components/LevelFounder.js
  74. 4
      plugins/plugins/core/components/NameMenu.js
  75. 4
      plugins/plugins/core/components/QRCode.js
  76. 2
      plugins/plugins/core/components/ReusableImage.js
  77. 4
      plugins/plugins/core/components/TipUser.js
  78. 2
      plugins/plugins/core/components/TradeInfoView.js
  79. 2
      plugins/plugins/core/components/TraderInfoView.js
  80. 8
      plugins/plugins/core/components/UserInfo/UserInfo.js
  81. 2
      plugins/plugins/core/components/frag-file-input.js
  82. 2
      plugins/plugins/core/components/qortal-info-view.js
  83. 2
      plugins/plugins/core/components/time-elements/extended-time-element.js
  84. 2
      plugins/plugins/core/components/time-elements/index.js
  85. 8
      plugins/plugins/core/group-management/group-management.src.js
  86. 4
      plugins/plugins/core/messaging/q-chat/q-chat.src.js
  87. 2
      plugins/plugins/core/minting/minting-info.src.js
  88. 2
      plugins/plugins/core/name-registration/name-registration.src.js
  89. 2
      plugins/plugins/core/names-market/names-market.src.js
  90. 2
      plugins/plugins/core/node-management/node-management.src.js
  91. 18
      plugins/plugins/core/overview-page/overview-page.src.js
  92. 2
      plugins/plugins/core/puzzles/puzzles.src.js
  93. 2
      plugins/plugins/core/q-app/q-apps.src.js
  94. 6
      plugins/plugins/core/qdn/browser/browser.src.js
  95. 2
      plugins/plugins/core/qdn/data-management/data-management.src.js
  96. 2
      plugins/plugins/core/qdn/publish/publish.src.js
  97. 2
      plugins/plugins/core/qdn/websites.src.js
  98. 190
      plugins/plugins/core/qortal-lottery/qortal-lottery.src.js
  99. 2
      plugins/plugins/core/reward-share/reward-share.src.js
  100. 6
      plugins/plugins/core/sponsorship-list/sponsorship-list.src.js
  101. Some files were not shown because too many files have changed in this diff Show More

6
core/src/apiKeyUtils.js

@ -49,8 +49,6 @@ export const testApiKey = async (apiKey) => {
let testRes = await api.request(testUrl, { let testRes = await api.request(testUrl, {
method: "GET" method: "GET"
}); });
if (testRes === true) { return testRes === true;
return true;
}
return false;
} }

32
core/src/components/app-view.js

@ -3,7 +3,7 @@ import { connect } from 'pwa-helpers'
import { store } from '../store.js' import { store } from '../store.js'
import { Epml } from '../epml.js' import { Epml } from '../epml.js'
import { addTradeBotRoutes } from '../tradebot/addTradeBotRoutes.js' import { addTradeBotRoutes } from '../tradebot/addTradeBotRoutes.js'
import { get, translate } from '../../translate/index.js' import { get, translate } from '../../translate'
import localForage from 'localforage' import localForage from 'localforage'
import { decryptData, encryptData } from '../lockScreen.js' import { decryptData, encryptData } from '../lockScreen.js'
import { setChatLastSeen } from '../redux/app/app-actions.js' import { setChatLastSeen } from '../redux/app/app-actions.js'
@ -560,7 +560,7 @@ class AppView extends connect(store)(LitElement) {
if(el3) { if(el3) {
els['checklist'] = el3 els['checklist'] = el3
} }
return els return els
} }
@ -965,7 +965,7 @@ class AppView extends connect(store)(LitElement) {
await appDelay(1000) await appDelay(1000)
if (this.isEmptyArray(this.tradeBotAvailableBtcQortal) === true) { if (this.isEmptyArray(this.tradeBotAvailableBtcQortal) === true) {
return
} else { } else {
const botbtcprice = this.round(parseFloat(this.tradeBotBtcBook[0].botBtcPrice)) const botbtcprice = this.round(parseFloat(this.tradeBotBtcBook[0].botBtcPrice))
const changebtcamount = parseFloat(this.tradeBotBtcBook[0].botBtcQortAmount) const changebtcamount = parseFloat(this.tradeBotBtcBook[0].botBtcQortAmount)
@ -1009,7 +1009,7 @@ class AppView extends connect(store)(LitElement) {
} }
if (this.isEmptyArray(this.tradeBotBtcBook) === true) { if (this.isEmptyArray(this.tradeBotBtcBook) === true) {
return
} else { } else {
const checkBotBtcFunds = this.round(parseFloat(this.tradeBotBtcBook[0].botBtcQortAmount) * parseFloat(this.tradeBotBtcBook[0].botBtcPrice)) const checkBotBtcFunds = this.round(parseFloat(this.tradeBotBtcBook[0].botBtcQortAmount) * parseFloat(this.tradeBotBtcBook[0].botBtcPrice))
const myBotBtcFunds = this.round(parseFloat(this.btcWalletBalance)) const myBotBtcFunds = this.round(parseFloat(this.btcWalletBalance))
@ -1162,7 +1162,7 @@ class AppView extends connect(store)(LitElement) {
await appDelay(1000) await appDelay(1000)
if (this.isEmptyArray(this.tradeBotAvailableLtcQortal) === true) { if (this.isEmptyArray(this.tradeBotAvailableLtcQortal) === true) {
return
} else { } else {
const botltcprice = this.round(parseFloat(this.tradeBotLtcBook[0].botLtcPrice)) const botltcprice = this.round(parseFloat(this.tradeBotLtcBook[0].botLtcPrice))
const changeltcamount = parseFloat(this.tradeBotLtcBook[0].botLtcQortAmount) const changeltcamount = parseFloat(this.tradeBotLtcBook[0].botLtcQortAmount)
@ -1206,7 +1206,7 @@ class AppView extends connect(store)(LitElement) {
} }
if (this.isEmptyArray(this.tradeBotLtcBook) === true) { if (this.isEmptyArray(this.tradeBotLtcBook) === true) {
return
} else { } else {
const checkBotLtcFunds = this.round(parseFloat(this.tradeBotLtcBook[0].botLtcQortAmount) * parseFloat(this.tradeBotLtcBook[0].botLtcPrice)) const checkBotLtcFunds = this.round(parseFloat(this.tradeBotLtcBook[0].botLtcQortAmount) * parseFloat(this.tradeBotLtcBook[0].botLtcPrice))
const myBotLtcFunds = this.round(parseFloat(this.ltcWalletBalance)) const myBotLtcFunds = this.round(parseFloat(this.ltcWalletBalance))
@ -1348,7 +1348,7 @@ class AppView extends connect(store)(LitElement) {
await appDelay(1000) await appDelay(1000)
if (this.isEmptyArray(this.tradeBotAvailableDogeQortal) === true) { if (this.isEmptyArray(this.tradeBotAvailableDogeQortal) === true) {
return
} else { } else {
const botdogeprice = this.round(parseFloat(this.tradeBotDogeBook[0].botDogePrice)) const botdogeprice = this.round(parseFloat(this.tradeBotDogeBook[0].botDogePrice))
const changedogeamount = parseFloat(this.tradeBotDogeBook[0].botDogeQortAmount) const changedogeamount = parseFloat(this.tradeBotDogeBook[0].botDogeQortAmount)
@ -1392,7 +1392,7 @@ class AppView extends connect(store)(LitElement) {
} }
if (this.isEmptyArray(this.tradeBotDogeBook) === true) { if (this.isEmptyArray(this.tradeBotDogeBook) === true) {
return
} else { } else {
const checkBotDogeFunds = this.round(parseFloat(this.tradeBotDogeBook[0].botDogeQortAmount) * parseFloat(this.tradeBotDogeBook[0].botDogePrice)) const checkBotDogeFunds = this.round(parseFloat(this.tradeBotDogeBook[0].botDogeQortAmount) * parseFloat(this.tradeBotDogeBook[0].botDogePrice))
const myBotDogeFunds = this.round(parseFloat(this.dogeWalletBalance)) const myBotDogeFunds = this.round(parseFloat(this.dogeWalletBalance))
@ -1534,7 +1534,7 @@ class AppView extends connect(store)(LitElement) {
await appDelay(1000) await appDelay(1000)
if (this.isEmptyArray(this.tradeBotAvailableDgbQortal) === true) { if (this.isEmptyArray(this.tradeBotAvailableDgbQortal) === true) {
return
} else { } else {
const botdgbprice = this.round(parseFloat(this.tradeBotDgbBook[0].botDgbPrice)) const botdgbprice = this.round(parseFloat(this.tradeBotDgbBook[0].botDgbPrice))
const changedgbamount = parseFloat(this.tradeBotDgbBook[0].botDgbQortAmount) const changedgbamount = parseFloat(this.tradeBotDgbBook[0].botDgbQortAmount)
@ -1578,7 +1578,7 @@ class AppView extends connect(store)(LitElement) {
} }
if (this.isEmptyArray(this.tradeBotDgbBook) === true) { if (this.isEmptyArray(this.tradeBotDgbBook) === true) {
return
} else { } else {
const checkBotDgbFunds = this.round(parseFloat(this.tradeBotDgbBook[0].botDgbQortAmount) * parseFloat(this.tradeBotDgbBook[0].botDgbPrice)) const checkBotDgbFunds = this.round(parseFloat(this.tradeBotDgbBook[0].botDgbQortAmount) * parseFloat(this.tradeBotDgbBook[0].botDgbPrice))
const myBotDgbFunds = this.round(parseFloat(this.dgbWalletBalance)) const myBotDgbFunds = this.round(parseFloat(this.dgbWalletBalance))
@ -1720,7 +1720,7 @@ class AppView extends connect(store)(LitElement) {
await appDelay(1000) await appDelay(1000)
if (this.isEmptyArray(this.tradeBotAvailableRvnQortal) === true) { if (this.isEmptyArray(this.tradeBotAvailableRvnQortal) === true) {
return
} else { } else {
const botrvnprice = this.round(parseFloat(this.tradeBotRvnBook[0].botRvnPrice)) const botrvnprice = this.round(parseFloat(this.tradeBotRvnBook[0].botRvnPrice))
const changervnamount = parseFloat(this.tradeBotRvnBook[0].botRvnQortAmount) const changervnamount = parseFloat(this.tradeBotRvnBook[0].botRvnQortAmount)
@ -1764,7 +1764,7 @@ class AppView extends connect(store)(LitElement) {
} }
if (this.isEmptyArray(this.tradeBotRvnBook) === true) { if (this.isEmptyArray(this.tradeBotRvnBook) === true) {
return
} else { } else {
const checkBotRvnFunds = this.round(parseFloat(this.tradeBotRvnBook[0].botRvnQortAmount) * parseFloat(this.tradeBotRvnBook[0].botRvnPrice)) const checkBotRvnFunds = this.round(parseFloat(this.tradeBotRvnBook[0].botRvnQortAmount) * parseFloat(this.tradeBotRvnBook[0].botRvnPrice))
const myBotRvnFunds = this.round(parseFloat(this.rvnWalletBalance)) const myBotRvnFunds = this.round(parseFloat(this.rvnWalletBalance))
@ -1906,7 +1906,7 @@ class AppView extends connect(store)(LitElement) {
await appDelay(1000) await appDelay(1000)
if (this.isEmptyArray(this.tradeBotAvailableArrrQortal) === true) { if (this.isEmptyArray(this.tradeBotAvailableArrrQortal) === true) {
return
} else { } else {
const botarrrprice = this.round(parseFloat(this.tradeBotArrrBook[0].botArrrPrice)) const botarrrprice = this.round(parseFloat(this.tradeBotArrrBook[0].botArrrPrice))
const changearrramount = parseFloat(this.tradeBotArrrBook[0].botArrrQortAmount) const changearrramount = parseFloat(this.tradeBotArrrBook[0].botArrrQortAmount)
@ -1950,7 +1950,7 @@ class AppView extends connect(store)(LitElement) {
} }
if (this.isEmptyArray(this.tradeBotArrrBook) === true) { if (this.isEmptyArray(this.tradeBotArrrBook) === true) {
return
} else { } else {
const checkBotArrrFunds = this.round(parseFloat(this.tradeBotArrrBook[0].botArrrQortAmount) * parseFloat(this.tradeBotArrrBook[0].botArrrPrice)) const checkBotArrrFunds = this.round(parseFloat(this.tradeBotArrrBook[0].botArrrQortAmount) * parseFloat(this.tradeBotArrrBook[0].botArrrPrice))
const myBotArrrFunds = this.round(parseFloat(this.arrrWalletBalance)) const myBotArrrFunds = this.round(parseFloat(this.arrrWalletBalance))
@ -2243,7 +2243,7 @@ class AppView extends connect(store)(LitElement) {
this.helperMessage = this.renderHelperErr() this.helperMessage = this.renderHelperErr()
await errDelay(3000) await errDelay(3000)
this.helperMessage = this.renderHelperPass() this.helperMessage = this.renderHelperPass()
return
} }
} }
@ -3365,4 +3365,4 @@ class AppView extends connect(store)(LitElement) {
} }
} }
window.customElements.define('app-view', AppView) window.customElements.define('app-view', AppView)

8
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 '@polymer/paper-spinner/paper-spinner-lite.js';
import '@vaadin/tooltip'; import '@vaadin/tooltip';
import '@material/mwc-button'; import '@material/mwc-button';
import { get, translate } from '../../../translate/index.js'; import { get, translate } from '../../../translate';
import '@polymer/paper-dialog/paper-dialog.js'; import '@polymer/paper-dialog/paper-dialog.js';
import { setNewTab } from '../../redux/app/app-actions.js'; import { setNewTab } from '../../redux/app/app-actions.js';
import { store } from '../../store.js'; import { store } from '../../store.js';
@ -116,7 +116,7 @@ class TourComponent extends connect(store)(LitElement) {
_controlOpenWelcomeModal() { _controlOpenWelcomeModal() {
this.isSynced = true this.isSynced = true
const seenWelcomeSync = JSON.parse( const seenWelcomeSync = JSON.parse(
localStorage.getItem('welcome-sync') || 'false' localStorage.getItem('welcome-sync') || 'false'
); );
@ -280,7 +280,7 @@ class TourComponent extends connect(store)(LitElement) {
<span><img src="/img/syncing.png" style="height: 24px; width: 24px; padding-top: 4px;" /></span> <span><img src="/img/syncing.png" style="height: 24px; width: 24px; padding-top: 4px;" /></span>
<p style="margin:0px;padding:0px">${get("tour.tour4")}</p> <p style="margin:0px;padding:0px">${get("tour.tour4")}</p>
</div> </div>
`, `,
}, },
}); });
@ -397,7 +397,7 @@ class TourComponent extends connect(store)(LitElement) {
class="close-button" class="close-button"
@click=${()=> { @click=${()=> {
this.onClose() this.onClose()
}} }}
> >
${translate("general.close")} ${translate("general.close")}

2
core/src/components/check-for-update.js

@ -1,5 +1,5 @@
import {css, html, LitElement} from 'lit' import {css, html, LitElement} from 'lit'
import {translate} from '../../translate/index.js' import {translate} from '../../translate'
import isElectron from 'is-electron' import isElectron from 'is-electron'
import '@polymer/paper-icon-button/paper-icon-button.js' import '@polymer/paper-icon-button/paper-icon-button.js'

8
core/src/components/friends-view/ChatSideNavHeads.js

@ -1,5 +1,5 @@
import {css, html, LitElement} from 'lit' import {css, html, LitElement} from 'lit'
import {get} from '../../../translate/index.js' import {get} from '../../../translate'
import '@material/mwc-icon' import '@material/mwc-icon'
import '@vaadin/tooltip'; import '@vaadin/tooltip';
@ -206,11 +206,9 @@ class ChatSideNavHeads extends LitElement {
if(changedProperties.has('chatInfo')){ if(changedProperties.has('chatInfo')){
return true return true
} }
if(changedProperties.has('isImageLoaded')){ return !!changedProperties.has('isImageLoaded');
return true
}
return false
} }
getUrl(chatUrl) { getUrl(chatUrl) {

2
core/src/components/friends-view/add-friends-modal.js

@ -1,5 +1,5 @@
import {css, html, LitElement} from 'lit'; import {css, html, LitElement} from 'lit';
import {translate,} from '../../../translate/index.js' import {translate,} from '../../../translate'
import '@material/mwc-button'; import '@material/mwc-button';
import '@material/mwc-dialog'; import '@material/mwc-dialog';
import '@material/mwc-checkbox'; import '@material/mwc-checkbox';

2
core/src/components/friends-view/avatar.js

@ -1,5 +1,5 @@
import { LitElement, html, css } from 'lit'; import { LitElement, html, css } from 'lit';
import { get, translate } from '../../../translate/index.js' import { get, translate } from '../../../translate'
import axios from 'axios'; import axios from 'axios';
import '@material/mwc-menu'; import '@material/mwc-menu';
import '@material/mwc-list/mwc-list-item.js'; import '@material/mwc-list/mwc-list-item.js';

10
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 { store } from '../../store.js';
import { setNewTab } from '../../redux/app/app-actions.js'; import { setNewTab } from '../../redux/app/app-actions.js';
import '@material/mwc-icon'; import '@material/mwc-icon';
import { get, translate } from '../../../translate/index.js'; import { get, translate } from '../../../translate';
import { repeat } from 'lit/directives/repeat.js'; import { repeat } from 'lit/directives/repeat.js';
import '../../../../plugins/plugins/core/components/TimeAgo.js'; import '../../../../plugins/plugins/core/components/TimeAgo.js';
import '../notification-view/popover.js'; import '../notification-view/popover.js';
@ -94,11 +94,7 @@ class BeginnerChecklist extends connect(store)(LitElement) {
const res = await fetch(endpoint); const res = await fetch(endpoint);
const getNames = await res.json(); const getNames = await res.json();
if (Array.isArray(getNames) && getNames.length > 0) { this.hasName = Array.isArray(getNames) && getNames.length > 0;
this.hasName = true;
} else {
this.hasName = false;
}
} catch (error) { } catch (error) {
return ''; return '';
} }
@ -132,7 +128,7 @@ class BeginnerChecklist extends connect(store)(LitElement) {
state.app.accountInfo.names.length > 0 state.app.accountInfo.names.length > 0
) { ) {
this.hasName = true; this.hasName = true;
} }
} }
handleBlur() { handleBlur() {

4
core/src/components/friends-view/core-sync-status.js

@ -1,7 +1,7 @@
import {css, html, LitElement} from 'lit' import {css, html, LitElement} from 'lit'
import {store} from '../../store' import {store} from '../../store'
import {connect} from 'pwa-helpers' import {connect} from 'pwa-helpers'
import {translate} from '../../../translate/index.js' import {translate} from '../../../translate'
class CoreSyncStatus extends connect(store)(LitElement) { class CoreSyncStatus extends connect(store)(LitElement) {
static get properties() { static get properties() {
@ -201,4 +201,4 @@ class CoreSyncStatus extends connect(store)(LitElement) {
} }
customElements.define('core-sync-status', CoreSyncStatus) customElements.define('core-sync-status', CoreSyncStatus)

2
core/src/components/friends-view/feed-item.js

@ -1,5 +1,5 @@
import {css, html, LitElement} from 'lit'; import {css, html, LitElement} from 'lit';
import {translate,} from '../../../translate/index.js' import {translate,} from '../../../translate'
import axios from 'axios' import axios from 'axios'
import '@material/mwc-menu'; import '@material/mwc-menu';
import '@material/mwc-list/mwc-list-item.js' import '@material/mwc-list/mwc-list-item.js'

2
core/src/components/friends-view/friend-item-actions.js

@ -2,7 +2,7 @@
import { css, html, LitElement } from 'lit'; import { css, html, LitElement } from 'lit';
import { createPopper } from '@popperjs/core'; import { createPopper } from '@popperjs/core';
import '@material/mwc-icon'; import '@material/mwc-icon';
import { translate } from '../../../translate/index.js' import { translate } from '../../../translate'
import { store } from '../../store'; import { store } from '../../store';
import { connect } from 'pwa-helpers'; import { connect } from 'pwa-helpers';
import { setNewTab, setSideEffectAction } from '../../redux/app/app-actions'; import { setNewTab, setSideEffectAction } from '../../redux/app/app-actions';

6
core/src/components/friends-view/friends-feed.js

@ -5,7 +5,7 @@ import {friendsViewStyles} from './friends-view-css';
import {connect} from 'pwa-helpers'; import {connect} from 'pwa-helpers';
import {store} from '../../store'; import {store} from '../../store';
import './feed-item' import './feed-item'
import {translate} from '../../../translate/index.js' import {translate} from '../../../translate'
import '@polymer/paper-spinner/paper-spinner-lite.js' import '@polymer/paper-spinner/paper-spinner-lite.js'
@ -216,7 +216,7 @@ this.getFeedOnInterval()
observerHandler(entries) { observerHandler(entries) {
if (!entries[0].isIntersecting) { if (!entries[0].isIntersecting) {
return;
} else { } else {
if (this.feedToRender.length < 20) { if (this.feedToRender.length < 20) {
return; return;
@ -375,7 +375,7 @@ this.getFeedOnInterval()
return false; return false;
}); });
} }
async loadAndMergeData() { async loadAndMergeData() {
let allData = this.feed let allData = this.feed

2
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 '@material/mwc-icon'
import './friends-side-panel.js' import './friends-side-panel.js'
import '@vaadin/tooltip' import '@vaadin/tooltip'
import {translate} from '../../../translate/index.js' import {translate} from '../../../translate'
class FriendsSidePanelParent extends LitElement { class FriendsSidePanelParent extends LitElement {
static get properties() { static get properties() {

2
core/src/components/friends-view/friends-side-panel.js

@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit';
import '@material/mwc-icon'; import '@material/mwc-icon';
import './friends-view' import './friends-view'
import './friends-feed' import './friends-feed'
import {translate} from '../../../translate/index.js' import {translate} from '../../../translate'
class FriendsSidePanel extends LitElement { class FriendsSidePanel extends LitElement {
static get properties() { static get properties() {

6
core/src/components/friends-view/friends-view.js

@ -13,7 +13,7 @@ import './ChatSideNavHeads';
import '../../../../plugins/plugins/core/components/ChatSearchResults' import '../../../../plugins/plugins/core/components/ChatSearchResults'
import './add-friends-modal' import './add-friends-modal'
import {translate,} from '../../../translate/index.js' import {translate,} from '../../../translate'
import {store} from '../../store'; import {store} from '../../store';
import {friendsViewStyles} from './friends-view-css'; import {friendsViewStyles} from './friends-view-css';
import {parentEpml} from '../show-plugin'; import {parentEpml} from '../show-plugin';
@ -125,7 +125,7 @@ class FriendsView extends connect(store)(LitElement) {
name name
}; };
} }
this.isOpenAddFriendsModal = true this.isOpenAddFriendsModal = true
this.openSidePanel() this.openSidePanel()
} }
@ -165,7 +165,7 @@ class FriendsView extends connect(store)(LitElement) {
observerHandler(entries) { observerHandler(entries) {
if (!entries[0].isIntersecting) { if (!entries[0].isIntersecting) {
return;
} else { } else {
if (this.friendList.length < 20) { if (this.friendList.length < 20) {
return; return;

14
core/src/components/friends-view/profile-modal-update.js

@ -1,6 +1,6 @@
import { LitElement, html, css } from 'lit'; import { LitElement, html, css } from 'lit';
import { render } from 'lit/html.js'; 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-button';
import '@material/mwc-icon'; import '@material/mwc-icon';
import '@vaadin/tooltip'; import '@vaadin/tooltip';
@ -274,7 +274,7 @@ class ProfileModalUpdate extends connect(store)(LitElement) {
this.requestUpdate(); this.requestUpdate();
} }
} }
async firstUpdated() { async firstUpdated() {
@ -549,12 +549,12 @@ class ProfileModalUpdate extends connect(store)(LitElement) {
<div <div
style="display:flex;justify-content:center;flex-direction:column;gap:25px" style="display:flex;justify-content:center;flex-direction:column;gap:25px"
> >
<div <div
style="display:flex;gap:15px;align-items:center" style="display:flex;gap:15px;align-items:center"
> >
<p <p
style="color: var(--black);font-size:16px" style="color: var(--black);font-size:16px"
> >
${key} ${key}
@ -592,9 +592,9 @@ class ProfileModalUpdate extends connect(store)(LitElement) {
> >
${translate('general.close')} ${translate('general.close')}
</button> </button>
<div style="display:flex;gap:10px;align-items:center"> <div style="display:flex;gap:10px;align-items:center">
<button <button
?disabled="${this.isLoading}" ?disabled="${this.isLoading}"
class="modal-button" class="modal-button"
@ -718,7 +718,7 @@ class ProfileModalUpdate extends connect(store)(LitElement) {
class="input" class="input"
.value=${this.newFieldName} .value=${this.newFieldName}
@change=${(e) => { @change=${(e) => {
this.newFieldName = e.target.value this.newFieldName = e.target.value
}} }}
/> />
<input <input

8
core/src/components/friends-view/profile.js

@ -6,7 +6,7 @@ import { store } from '../../store.js';
import WebWorker2 from '../WebWorkerFile.js'; import WebWorker2 from '../WebWorkerFile.js';
import '@polymer/paper-spinner/paper-spinner-lite.js'; import '@polymer/paper-spinner/paper-spinner-lite.js';
import '@vaadin/tooltip'; import '@vaadin/tooltip';
import { get, translate } from '../../../translate/index.js' import { get, translate } from '../../../translate'
import ShortUniqueId from 'short-unique-id'; import ShortUniqueId from 'short-unique-id';
import '@polymer/paper-dialog/paper-dialog.js'; import '@polymer/paper-dialog/paper-dialog.js';
@ -814,11 +814,7 @@ class ProfileQdn extends connect(store)(LitElement) {
const findIndex = friendList.findIndex( const findIndex = friendList.findIndex(
(friend) => friend.name === name (friend) => friend.name === name
); );
if (findIndex !== -1) { this.isFriend = findIndex !== -1;
this.isFriend = true;
} else {
this.isFriend = false;
}
} catch (error) {} } catch (error) {}
} }
render() { render() {

6
core/src/components/friends-view/save-settings-qdn.js

@ -6,12 +6,12 @@ import { store } from '../../store.js';
import WebWorker from '../WebWorkerFile.js'; import WebWorker from '../WebWorkerFile.js';
import '@polymer/paper-spinner/paper-spinner-lite.js'; import '@polymer/paper-spinner/paper-spinner-lite.js';
import '@vaadin/tooltip'; import '@vaadin/tooltip';
import { get, translate } from '../../../translate/index.js' import { get, translate } from '../../../translate'
import ShortUniqueId from 'short-unique-id'; import ShortUniqueId from 'short-unique-id';
import { import {
decryptGroupData, decryptGroupData,
encryptDataGroup, encryptDataGroup,
objectToBase64, objectToBase64,
uint8ArrayToObject, uint8ArrayToObject,
@ -331,7 +331,7 @@ class SaveSettingsQdn extends connect(store)(LitElement) {
nameObject = store.getState().app.accountInfo.names[0]; nameObject = store.getState().app.accountInfo.names[0];
} catch (error) { } catch (error) {
} }
if (!nameObject) { if (!nameObject) {
this.name = null; this.name = null;

2
core/src/components/language-selector.js

@ -1,5 +1,5 @@
import {css, html, LitElement} from 'lit' import {css, html, LitElement} from 'lit'
import {registerTranslateConfig, translate, use} from '../../translate/index.js' import {registerTranslateConfig, translate, use} from '../../translate'
registerTranslateConfig({ registerTranslateConfig({
loader: lang => fetch(`/language/${lang}.json`).then(res => res.json()) loader: lang => fetch(`/language/${lang}.json`).then(res => res.json())

2
core/src/components/login-view/create-account-section.js

@ -1,7 +1,7 @@
import {css, html, LitElement} from 'lit' import {css, html, LitElement} from 'lit'
import {connect} from 'pwa-helpers' import {connect} from 'pwa-helpers'
import {store} from '../../store.js' import {store} from '../../store.js'
import {get, translate} from '../../../translate/index.js' import {get, translate} from '../../../translate'
import {createWallet} from '../../../../crypto/api/createWallet.js' import {createWallet} from '../../../../crypto/api/createWallet.js'
import {doLogin, doLogout, doSelectAddress} from '../../redux/app/app-actions.js' import {doLogin, doLogout, doSelectAddress} from '../../redux/app/app-actions.js'

2
core/src/components/login-view/login-section.js

@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit'
import {connect} from 'pwa-helpers' import {connect} from 'pwa-helpers'
import {store} from '../../store.js' import {store} from '../../store.js'
import {checkApiKey} from '../../apiKeyUtils.js' import {checkApiKey} from '../../apiKeyUtils.js'
import {translate} from '../../../translate/index.js' import {translate} from '../../../translate'
import '@material/mwc-button' import '@material/mwc-button'
import '@material/mwc-checkbox' import '@material/mwc-checkbox'

2
core/src/components/login-view/login-view.js

@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit'
import {connect} from 'pwa-helpers' import {connect} from 'pwa-helpers'
import {store} from '../../store.js' import {store} from '../../store.js'
import {stateAwait} from '../../stateAwait.js' import {stateAwait} from '../../stateAwait.js'
import {get} from '../../../translate/index.js' import {get} from '../../../translate'
import '@material/mwc-button' import '@material/mwc-button'
import '@material/mwc-icon' import '@material/mwc-icon'

4
core/src/components/login-view/particle.js

@ -1255,11 +1255,11 @@ function hexToRgb(hex) {
g: parseInt(result[2], 16), g: parseInt(result[2], 16),
b: parseInt(result[3], 16) b: parseInt(result[3], 16)
} : null } : null
}; }
function clamp(number, min, max) { function clamp(number, min, max) {
return Math.min(Math.max(number, min), max) return Math.min(Math.max(number, min), max)
}; }
function isInArray(value, array) { function isInArray(value, array) {
return array.indexOf(value) > -1 return array.indexOf(value) > -1

2
core/src/components/login-view/welcome-page.js

@ -1,5 +1,5 @@
import {css, html, LitElement} from 'lit' import {css, html, LitElement} from 'lit'
import {translate} from '../../../translate/index.js' import {translate} from '../../../translate'
import '@material/mwc-button' import '@material/mwc-button'

2
core/src/components/logout-view/logout-view.js

@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit'
import {connect} from 'pwa-helpers' import {connect} from 'pwa-helpers'
import {store} from '../../store.js' import {store} from '../../store.js'
import {doLogout} from '../../redux/app/app-actions.js' import {doLogout} from '../../redux/app/app-actions.js'
import {translate} from '../../../translate/index.js' import {translate} from '../../../translate'
import '@polymer/paper-dialog/paper-dialog.js' import '@polymer/paper-dialog/paper-dialog.js'
import '@material/mwc-button' import '@material/mwc-button'

2
core/src/components/new-selector.js

@ -1,5 +1,5 @@
import {css, html, LitElement} from 'lit' import {css, html, LitElement} from 'lit'
import {registerTranslateConfig, translate, use} from '../../translate/index.js' import {registerTranslateConfig, translate, use} from '../../translate'
registerTranslateConfig({ registerTranslateConfig({
loader: lang => fetch(`/language/${lang}.json`).then(res => res.json()) loader: lang => fetch(`/language/${lang}.json`).then(res => res.json())

3
core/src/components/notification-view/notification-bell-general.js

@ -8,7 +8,7 @@ import '@polymer/iron-icons/iron-icons.js';
import {store} from '../../store.js'; import {store} from '../../store.js';
import {setNewNotification} from '../../redux/app/app-actions.js'; import {setNewNotification} from '../../redux/app/app-actions.js';
import '@material/mwc-icon'; import '@material/mwc-icon';
import {get, translate} from '../../../translate/index.js' import {get, translate} from '../../../translate'
import {repeat} from 'lit/directives/repeat.js'; import {repeat} from 'lit/directives/repeat.js';
import '../../../../plugins/plugins/core/components/TimeAgo.js'; import '../../../../plugins/plugins/core/components/TimeAgo.js';
import './popover.js'; import './popover.js';
@ -20,7 +20,6 @@ class NotificationBellGeneral extends connect(store)(LitElement) {
showNotifications: { type: Boolean }, showNotifications: { type: Boolean },
notificationCount: { type: Boolean }, notificationCount: { type: Boolean },
theme: { type: String, reflect: true }, theme: { type: String, reflect: true },
notifications: { type: Array },
currentNotification: { type: Object }, currentNotification: { type: Object },
}; };

6
core/src/components/notification-view/notification-bell.js

@ -111,11 +111,7 @@ class NotificationBell extends connect(store)(LitElement) {
} }
this.notifications = notificationsToShow this.notifications = notificationsToShow
if (this.notifications.length === 0) { this.notificationCount = this.notifications.length !== 0;
this.notificationCount = false
} else {
this.notificationCount = true
}
if (!this.initialFetch) this.initialFetch = true if (!this.initialFetch) this.initialFetch = true
} catch (error) { } catch (error) {

4
core/src/components/search-modal.js

@ -1,5 +1,5 @@
import {css, html, LitElement} from 'lit' import {css, html, LitElement} from 'lit'
import {get, translate} from '../../translate/index.js' import {get, translate} from '../../translate'
import snackbar from '../functional-components/snackbar.js' import snackbar from '../functional-components/snackbar.js'
import '@polymer/paper-icon-button/paper-icon-button.js' import '@polymer/paper-icon-button/paper-icon-button.js'
@ -118,7 +118,7 @@ class SearchModal extends LitElement {
dismiss: true dismiss: true
}) })
this.shadowRoot.getElementById('searchContent').value = this.searchContentString this.shadowRoot.getElementById('searchContent').value = this.searchContentString
return
} else { } else {
let sendInfoAddress = this.shadowRoot.getElementById('searchContent').value let sendInfoAddress = this.shadowRoot.getElementById('searchContent').value
const infoDialog = document.getElementById('main-app').shadowRoot.querySelector('app-view').shadowRoot.querySelector('user-info-view') const infoDialog = document.getElementById('main-app').shadowRoot.querySelector('app-view').shadowRoot.querySelector('user-info-view')

4
core/src/components/settings-view/account-view.js

@ -1,7 +1,7 @@
import { LitElement, html, css } from 'lit' import { LitElement, html, css } from 'lit'
import { connect } from 'pwa-helpers' import { connect } from 'pwa-helpers'
import { store } from '../../store.js' import { store } from '../../store.js'
import { get, translate } from '../../../translate/index.js' import { get, translate } from '../../../translate'
class AccountView extends connect(store)(LitElement) { class AccountView extends connect(store)(LitElement) {
static get properties() { static get properties() {
@ -136,4 +136,4 @@ class AccountView extends connect(store)(LitElement) {
} }
} }
window.customElements.define('account-view', AccountView) window.customElements.define('account-view', AccountView)

2
core/src/components/settings-view/export-keys.js

@ -3,7 +3,7 @@ import {connect} from 'pwa-helpers'
import {store} from '../../store.js' import {store} from '../../store.js'
import { Epml } from '../../epml.js' import { Epml } from '../../epml.js'
import { addTradeBotRoutes } from '../../tradebot/addTradeBotRoutes.js' import { addTradeBotRoutes } from '../../tradebot/addTradeBotRoutes.js'
import {get, translate} from '../../../translate/index.js' import {get, translate} from '../../../translate'
import snackbar from '../../functional-components/snackbar.js' import snackbar from '../../functional-components/snackbar.js'
import FileSaver from 'file-saver' import FileSaver from 'file-saver'

2
core/src/components/settings-view/notifications-view.js

@ -3,7 +3,7 @@ import {connect} from 'pwa-helpers'
import {store} from '../../store.js' import {store} from '../../store.js'
import {allowShowSyncIndicator, removeShowSyncIndicator} from '../../redux/app/app-actions.js' import {allowShowSyncIndicator, removeShowSyncIndicator} from '../../redux/app/app-actions.js'
import {doSetQChatNotificationConfig} from '../../redux/user/user-actions.js' import {doSetQChatNotificationConfig} from '../../redux/user/user-actions.js'
import {translate} from '../../../translate/index.js' import {translate} from '../../../translate'
import isElectron from 'is-electron' import isElectron from 'is-electron'
import '@material/mwc-checkbox' import '@material/mwc-checkbox'

2
core/src/components/settings-view/qr-login-view.js

@ -1,7 +1,7 @@
import {css, html, LitElement} from 'lit' import {css, html, LitElement} from 'lit'
import {connect} from 'pwa-helpers' import {connect} from 'pwa-helpers'
import {store} from '../../store.js' import {store} from '../../store.js'
import {translate} from '../../../translate/index.js' import {translate} from '../../../translate'
import '@material/mwc-textfield' import '@material/mwc-textfield'
import '@material/mwc-icon' import '@material/mwc-icon'

2
core/src/components/settings-view/security-view.js

@ -10,7 +10,7 @@ import {
removeQAPPAutoLists, removeQAPPAutoLists,
setIsOpenDevDialog setIsOpenDevDialog
} from '../../redux/app/app-actions.js' } from '../../redux/app/app-actions.js'
import {get, translate} from '../../../translate/index.js' import {get, translate} from '../../../translate'
import snackbar from '../../functional-components/snackbar.js' import snackbar from '../../functional-components/snackbar.js'
import FileSaver from 'file-saver' import FileSaver from 'file-saver'

2
core/src/components/settings-view/user-settings.js

@ -1,7 +1,7 @@
import {css, html, LitElement} from 'lit' import {css, html, LitElement} from 'lit'
import {connect} from 'pwa-helpers' import {connect} from 'pwa-helpers'
import {store} from '../../store.js' import {store} from '../../store.js'
import {translate} from '../../../translate/index.js' import {translate} from '../../../translate'
import '@polymer/paper-dialog/paper-dialog.js' import '@polymer/paper-dialog/paper-dialog.js'
import '@material/mwc-button' import '@material/mwc-button'

14
core/src/components/show-plugin.js

@ -8,7 +8,7 @@ import {repeat} from 'lit/directives/repeat.js';
import ShortUniqueId from 'short-unique-id'; import ShortUniqueId from 'short-unique-id';
import {setIsOpenDevDialog, setNewTab} from '../redux/app/app-actions.js' import {setIsOpenDevDialog, setNewTab} from '../redux/app/app-actions.js'
import FileSaver from 'file-saver' import FileSaver from 'file-saver'
import {get, registerTranslateConfig, translate, use} from '../../translate/index.js' import {get, registerTranslateConfig, translate, use} from '../../translate'
import '@material/mwc-button' import '@material/mwc-button'
import '@material/mwc-dialog' import '@material/mwc-dialog'
import '@material/mwc-icon' import '@material/mwc-icon'
@ -1995,11 +1995,7 @@ class NavBar extends connect(store)(LitElement) {
this.myPluginNameRes = res this.myPluginNameRes = res
}) })
if (this.myPluginNameRes === undefined || this.myPluginNameRes.length == 0) { myPluginName = !(this.myPluginNameRes === undefined || this.myPluginNameRes.length == 0);
myPluginName = false
} else {
myPluginName = true
}
return myPluginName return myPluginName
} }
@ -2060,11 +2056,7 @@ class NavBar extends connect(store)(LitElement) {
this.myPluginNameRes = res this.myPluginNameRes = res
}) })
if (this.myPluginNameRes === undefined || this.myPluginNameRes.length == 0 ) { myPluginName = !(this.myPluginNameRes === undefined || this.myPluginNameRes.length == 0);
myPluginName = false
} else {
myPluginName = true
}
return myPluginName return myPluginName
} }

6
core/src/components/start-minting.js

@ -1,7 +1,7 @@
import {css, html, LitElement} from 'lit'; import {css, html, LitElement} from 'lit';
import {connect} from 'pwa-helpers'; import {connect} from 'pwa-helpers';
import {store} from '../store.js'; import {store} from '../store.js';
import {get, translate} from '../../translate/index.js' import {get, translate} from '../../translate'
import {asyncReplace} from 'lit/directives/async-replace.js'; import {asyncReplace} from 'lit/directives/async-replace.js';
import '../functional-components/my-button.js'; import '../functional-components/my-button.js';
@ -293,7 +293,7 @@ const nonce = selectedAddress && selectedAddress.nonce;
this.getMintingAcccounts(); this.getMintingAcccounts();
} catch (error) { } catch (error) {
this.errorMsg = this.renderErrorMsg3(); this.errorMsg = this.renderErrorMsg3();
return;
} }
} }
@ -426,7 +426,7 @@ const nonce = selectedAddress && selectedAddress.nonce;
} catch (error) { } catch (error) {
console.log({ error }) console.log({ error })
this.errorMsg = (error && error.data && error.data.message) ? error.data.message : this.renderErrorMsg4(); this.errorMsg = (error && error.data && error.data.message) ? error.data.message : this.renderErrorMsg4();
return;
} }
}; };

2
core/src/components/theme-toggle.js

@ -1,5 +1,5 @@
import {css, html, LitElement} from 'lit' import {css, html, LitElement} from 'lit'
import {translate} from '../../translate/index.js' import {translate} from '../../translate'
import '@polymer/paper-icon-button/paper-icon-button.js' import '@polymer/paper-icon-button/paper-icon-button.js'
import '@polymer/iron-icons/image-icons.js' import '@polymer/iron-icons/image-icons.js'
import '@polymer/iron-icons/iron-icons.js' import '@polymer/iron-icons/iron-icons.js'

2
core/src/components/user-info-view/user-info-view.js

@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit'
import {render} from 'lit/html.js' import {render} from 'lit/html.js'
import {connect} from 'pwa-helpers' import {connect} from 'pwa-helpers'
import {store} from '../../store.js' import {store} from '../../store.js'
import {get, translate} from '../../../translate/index.js' import {get, translate} from '../../../translate'
import '@polymer/paper-dialog/paper-dialog.js' import '@polymer/paper-dialog/paper-dialog.js'
import '@material/mwc-button' import '@material/mwc-button'

2
core/src/custom-elements/frag-file-input.js

@ -3,7 +3,7 @@ import {css, html, LitElement} from 'lit'
import '@material/mwc-button' import '@material/mwc-button'
import '@material/mwc-icon' import '@material/mwc-icon'
import {translate} from '../../translate/index.js' import {translate} from '../../translate'
class FragFileInput extends LitElement { class FragFileInput extends LitElement {
static get properties () { static get properties () {

2
core/src/functional-components/confirm-transaction-dialog.js

@ -1,7 +1,7 @@
import {css, html, LitElement} from 'lit' import {css, html, LitElement} from 'lit'
import {connect} from 'pwa-helpers' import {connect} from 'pwa-helpers'
import {store} from '../store.js' import {store} from '../store.js'
import {get, translate} from '../../translate/index.js' import {get, translate} from '../../translate'
import {listenForRequest} from '../transactionRequest.js' import {listenForRequest} from '../transactionRequest.js'

2
core/src/functional-components/mykey-page.js

@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit'
import {connect} from 'pwa-helpers' import {connect} from 'pwa-helpers'
import {store} from '../store.js' import {store} from '../store.js'
import {testApiKey} from '../apiKeyUtils.js' import {testApiKey} from '../apiKeyUtils.js'
import {get, translate} from '../../translate/index.js' import {get, translate} from '../../translate'
import '@material/mwc-dialog' import '@material/mwc-dialog'
import '@material/mwc-button' import '@material/mwc-button'

2
core/src/functional-components/settings-page.js

@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit'
import {connect} from 'pwa-helpers' import {connect} from 'pwa-helpers'
import {store} from '../store.js' import {store} from '../store.js'
import {doAddNode, doEditNode, doLoadNodeConfig, doRemoveNode, doSetNode} from '../redux/app/app-actions.js' import {doAddNode, doEditNode, doLoadNodeConfig, doRemoveNode, doSetNode} from '../redux/app/app-actions.js'
import {get, registerTranslateConfig, translate, use} from '../../translate/index.js' import {get, registerTranslateConfig, translate, use} from '../../translate'
import snackbar from './snackbar.js' import snackbar from './snackbar.js'
import '../components/language-selector.js' import '../components/language-selector.js'
import '../custom-elements/frag-file-input.js' import '../custom-elements/frag-file-input.js'

2
crypto/api/decryptStoredWallet.js

@ -1,7 +1,7 @@
import Base58 from './deps/Base58.js' import Base58 from './deps/Base58.js'
import {kdf} from './kdf.js' import {kdf} from './kdf.js'
import {AES_CBC, HmacSha512} from 'asmcrypto.js' import {AES_CBC, HmacSha512} from 'asmcrypto.js'
import {get, registerTranslateConfig} from '../../core/translate/index.js' import {get, registerTranslateConfig} from '../../core/translate'
registerTranslateConfig({ registerTranslateConfig({
loader: lang => fetch(`/language/${lang}.json`).then(res => res.json()) loader: lang => fetch(`/language/${lang}.json`).then(res => res.json())

2
crypto/api/kdf.js

@ -2,7 +2,7 @@ import {store} from '../api_deps.js'
import {stateAwait} from './utils/stateAwait.js' import {stateAwait} from './utils/stateAwait.js'
import {Sha512} from 'asmcrypto.js' import {Sha512} from 'asmcrypto.js'
import utils from '../api/deps/utils.js' import utils from '../api/deps/utils.js'
import {get, registerTranslateConfig} from '../../core/translate/index.js' import {get, registerTranslateConfig} from '../../core/translate'
registerTranslateConfig({ registerTranslateConfig({
loader: lang => fetch(`/language/${lang}.json`).then(res => res.json()) loader: lang => fetch(`/language/${lang}.json`).then(res => res.json())

6
crypto/api/wallet/validateAddress.js

@ -3,8 +3,6 @@ import Base58 from '../deps/Base58.js'
export const validateAddress = (address) => { export const validateAddress = (address) => {
const decodePubKey = Base58.decode(address) const decodePubKey = Base58.decode(address)
if (!(decodePubKey instanceof Uint8Array && decodePubKey.length == 25)) { return decodePubKey instanceof Uint8Array && decodePubKey.length == 25;
return false
}
return true
} }

40
electron.js

@ -168,11 +168,7 @@ function doesFileExist(urlToJavaFile) {
xhr.open('HEAD', urlToJavaFile, true) xhr.open('HEAD', urlToJavaFile, true)
xhr.send() xhr.send()
if (xhr.status == "404") { return xhr.status != "404";
return false
} else {
return true
}
} }
async function checkWin() { async function checkWin() {
@ -197,7 +193,7 @@ async function checkWin() {
store.set('askingCore', returnValue.checkboxChecked) store.set('askingCore', returnValue.checkboxChecked)
} else { } else {
store.set('askingCore', returnValue.checkboxChecked) store.set('askingCore', returnValue.checkboxChecked)
return
} }
}) })
} }
@ -215,7 +211,7 @@ async function checkWin() {
if (returnValue.response === 0) { if (returnValue.response === 0) {
downloadWindows() downloadWindows()
} else { } else {
return
} }
}) })
} }
@ -227,7 +223,7 @@ async function checkOsPlatform() {
} else if (process.platform === 'linux' || process.platform === 'darwin') { } else if (process.platform === 'linux' || process.platform === 'darwin') {
startElectronUnix() startElectronUnix()
} else { } else {
return
} }
} }
@ -252,7 +248,7 @@ async function startElectronWin() {
if (returnValue.response === 0) { if (returnValue.response === 0) {
downloadWindows() downloadWindows()
} else { } else {
return
} }
}) })
} }
@ -279,7 +275,7 @@ function startElectronUnix() {
if (returnValue.response === 0) { if (returnValue.response === 0) {
downloadQortal() downloadQortal()
} else { } else {
return
} }
}) })
} }
@ -340,7 +336,7 @@ async function checkPort() {
async function checkResponseStatus(res) { async function checkResponseStatus(res) {
if (res.ok) { if (res.ok) {
return
} else if (process.platform === 'win32') { } else if (process.platform === 'win32') {
await checkWin() await checkWin()
} else { } else {
@ -382,7 +378,7 @@ async function javaversion() {
}) })
checkJava.stderr.on('end', () => { checkJava.stderr.on('end', () => {
datres = Buffer.concat(stderrChunks).toString().split('\n')[0] let datres = Buffer.concat(stderrChunks).toString().split('\n')[0]
const javaVersion = new RegExp('(java|openjdk) version').test(datres) ? datres.split(' ')[2].replace(/"/g, '') : false; const javaVersion = new RegExp('(java|openjdk) version').test(datres) ? datres.split(' ')[2].replace(/"/g, '') : false;
log.info("Java Version", javaVersion) log.info("Java Version", javaVersion)
if (javaVersion != false) { if (javaVersion != false) {
@ -399,7 +395,7 @@ async function javaversion() {
if (returnValue.response === 0) { if (returnValue.response === 0) {
installJava() installJava()
} else { } else {
return
} }
}) })
} }
@ -706,7 +702,7 @@ function checkQortal() {
store.set('askingCore', returnValue.checkboxChecked) store.set('askingCore', returnValue.checkboxChecked)
} else { } else {
store.set('askingCore', returnValue.checkboxChecked) store.set('askingCore', returnValue.checkboxChecked)
return
} }
}) })
} }
@ -724,7 +720,7 @@ function checkQortal() {
if (returnValue.response === 0) { if (returnValue.response === 0) {
downloadQortal() downloadQortal()
} else { } else {
return
} }
}) })
} }
@ -807,7 +803,7 @@ async function checkAndStart() {
store.set('askingCore', returnValue.checkboxChecked) store.set('askingCore', returnValue.checkboxChecked)
} else { } else {
store.set('askingCore', returnValue.checkboxChecked) store.set('askingCore', returnValue.checkboxChecked)
return
} }
}) })
} }
@ -986,7 +982,7 @@ const editMenu = Menu.buildFromTemplate([
store.set('askingCore', returnValue.checkboxChecked) store.set('askingCore', returnValue.checkboxChecked)
} else { } else {
store.set('askingCore', returnValue.checkboxChecked) store.set('askingCore', returnValue.checkboxChecked)
return
} }
}) })
} }
@ -1143,7 +1139,7 @@ const createTray = () => {
store.set('askingCore', returnValue.checkboxChecked) store.set('askingCore', returnValue.checkboxChecked)
} else { } else {
store.set('askingCore', returnValue.checkboxChecked) store.set('askingCore', returnValue.checkboxChecked)
return
} }
}) })
}, },
@ -1243,7 +1239,7 @@ if (!isLock) {
store.set('askingCore', returnValue.checkboxChecked) store.set('askingCore', returnValue.checkboxChecked)
} else { } else {
store.set('askingCore', returnValue.checkboxChecked) store.set('askingCore', returnValue.checkboxChecked)
return
} }
}) })
}) })
@ -1329,7 +1325,7 @@ if (!isLock) {
}) })
dl.show() dl.show()
} else { } else {
return
} }
}) })
}) })
@ -1351,7 +1347,7 @@ if (!isLock) {
if (returnValue.response === 0) { if (returnValue.response === 0) {
autoUpdater.quitAndInstall() autoUpdater.quitAndInstall()
} else { } else {
return
} }
}) })
}) })
@ -1372,4 +1368,4 @@ if (!isLock) {
process.on('uncaughtException', function (err) { process.on('uncaughtException', function (err) {
log.info("*** WHOOPS TIME ***" + err) log.info("*** WHOOPS TIME ***" + err)
}) })
} }

2
plugins/plugins/core/become-minter/become-minter.src.js

@ -1,7 +1,7 @@
import {html, LitElement} from 'lit' import {html, LitElement} from 'lit'
import {Epml} from '../../../epml.js' import {Epml} from '../../../epml.js'
import '../components/ButtonIconCopy.js' import '../components/ButtonIconCopy.js'
import {registerTranslateConfig, translate, use} from '../../../../core/translate/index.js' import {registerTranslateConfig, translate, use} from '../../../../core/translate'
import {blocksNeed} from '../../utils/blocks-needed.js' import {blocksNeed} from '../../utils/blocks-needed.js'
import isElectron from 'is-electron' import isElectron from 'is-electron'
import '@polymer/paper-spinner/paper-spinner-lite.js' import '@polymer/paper-spinner/paper-spinner-lite.js'

2
plugins/plugins/core/become-minter/components/not-sponsored.js

@ -1,7 +1,7 @@
import {html, LitElement} from 'lit' import {html, LitElement} from 'lit'
import {Epml} from '../../../../epml.js' import {Epml} from '../../../../epml.js'
import '../../components/ButtonIconCopy.js' import '../../components/ButtonIconCopy.js'
import {translate} from '../../../../../core/translate/index.js' import {translate} from '../../../../../core/translate'
import '@polymer/paper-spinner/paper-spinner-lite.js' import '@polymer/paper-spinner/paper-spinner-lite.js'
import '@material/mwc-button' import '@material/mwc-button'

2
plugins/plugins/core/become-minter/components/yes-sponsored.js

@ -1,6 +1,6 @@
import {html, LitElement} from 'lit' import {html, LitElement} from 'lit'
import '../../components/ButtonIconCopy.js' import '../../components/ButtonIconCopy.js'
import {translate} from '../../../../../core/translate/index.js' import {translate} from '../../../../../core/translate'
import '@polymer/paper-spinner/paper-spinner-lite.js' import '@polymer/paper-spinner/paper-spinner-lite.js'
import '@material/mwc-button' import '@material/mwc-button'

14
plugins/plugins/core/components/ChatGifs/ChatGifs.js

@ -9,7 +9,7 @@ import {bytesToMegabytes} from '../../../utils/bytesToMegabytes.js';
import './ChatGifsExplore.js'; import './ChatGifsExplore.js';
import '../ImageComponent.js'; import '../ImageComponent.js';
import '@vaadin/tooltip'; import '@vaadin/tooltip';
import {get, translate} from '../../../../../core/translate/index.js' import {get, translate} from '../../../../../core/translate'
const parentEpml = new Epml({type: 'WINDOW', source: window.parent}); const parentEpml = new Epml({type: 'WINDOW', source: window.parent});
@ -150,11 +150,7 @@ setOpenGifModal: { attribute: false }
if (changedProperties && changedProperties.has('currentCollection')) { if (changedProperties && changedProperties.has('currentCollection')) {
if (this.mode === 'explore') { if (this.mode === 'explore') {
const subbedCollection = this.mySubscribedCollections.find((collection) => ((collection.name === this.currentCollection.name) && (collection.identifier === this.currentCollection.identifier))); const subbedCollection = this.mySubscribedCollections.find((collection) => ((collection.name === this.currentCollection.name) && (collection.identifier === this.currentCollection.identifier)));
if (subbedCollection) { this.isSubscribed = !!subbedCollection;
this.isSubscribed = true;
} else {
this.isSubscribed = false;
}
} }
} }
} }
@ -440,11 +436,7 @@ setOpenGifModal: { attribute: false }
} }
} }
if (invalidGifs.length > 0) { return invalidGifs.length <= 0;
return false;
} else {
return true;
}
} }
let validatedSize = validateGifSizes(this.gifsToBeAdded); let validatedSize = validateGifSizes(this.gifsToBeAdded);

4
plugins/plugins/core/components/ChatGifs/ChatGifsExplore.js

@ -1,7 +1,7 @@
import {html, LitElement} from 'lit' import {html, LitElement} from 'lit'
import {Epml} from '../../../../epml.js' import {Epml} from '../../../../epml.js'
import {chatGifsExploreStyles} from './ChatGifsExplore-css.js' import {chatGifsExploreStyles} from './ChatGifsExplore-css.js'
import {get, translate} from '../../../../../core/translate/index.js' import {get, translate} from '../../../../../core/translate'
import '@material/mwc-icon' import '@material/mwc-icon'
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent }); const parentEpml = new Epml({ type: 'WINDOW', source: window.parent });
@ -52,7 +52,7 @@ class ChatGifsExplore extends LitElement {
observerHandler(entries) { observerHandler(entries) {
if (!entries[0].isIntersecting) { if (!entries[0].isIntersecting) {
return;
} else { } else {
if (this.exploreCollections.length < 20) { if (this.exploreCollections.length < 20) {
return; return;

2
plugins/plugins/core/components/ChatGroupInvites.js

@ -5,7 +5,7 @@ import "@material/mwc-dialog"
import "@polymer/paper-spinner/paper-spinner-lite.js" import "@polymer/paper-spinner/paper-spinner-lite.js"
import "@material/mwc-icon" import "@material/mwc-icon"
import "./WrapperModal" import "./WrapperModal"
import {translate} from '../../../../core/translate/index.js' import {translate} from '../../../../core/translate'
const parentEpml = new Epml({ type: "WINDOW", source: window.parent }) const parentEpml = new Epml({ type: "WINDOW", source: window.parent })

16
plugins/plugins/core/components/ChatGroupManager.js

@ -11,7 +11,7 @@ import './TipUser';
import './UserInfo/UserInfo'; import './UserInfo/UserInfo';
import './ChatImage'; import './ChatImage';
import './ReusableImage'; import './ReusableImage';
import {get} from '../../../../core/translate/index.js' import {get} from '../../../../core/translate'
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent }); const parentEpml = new Epml({ type: 'WINDOW', source: window.parent });
@ -284,7 +284,7 @@ class ChatGroupsManager extends LitElement {
observerHandler(entries) { observerHandler(entries) {
if (!entries[0].isIntersecting) { if (!entries[0].isIntersecting) {
return;
} else { } else {
if (this.images.length < 20) { if (this.images.length < 20) {
return; return;
@ -294,19 +294,11 @@ class ChatGroupsManager extends LitElement {
} }
selectAuto(e) { selectAuto(e) {
if (e.target.checked) { this.autoView = !e.target.checked;
this.autoView = false
} else {
this.autoView = true
}
} }
selectMyImages(e) { selectMyImages(e) {
if (e.target.checked) { this.onlyMyImages = !e.target.checked;
this.onlyMyImages = false
} else {
this.onlyMyImages = true
}
} }
render() { render() {

2
plugins/plugins/core/components/ChatGroupSettings.js

@ -5,7 +5,7 @@ import '@material/mwc-dialog'
import '@polymer/paper-spinner/paper-spinner-lite.js' import '@polymer/paper-spinner/paper-spinner-lite.js'
import '@material/mwc-icon' import '@material/mwc-icon'
import './WrapperModal' import './WrapperModal'
import {get, translate} from '../../../../core/translate/index.js' import {get, translate} from '../../../../core/translate'
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent }) const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })

2
plugins/plugins/core/components/ChatGroupsManagement.js

@ -10,7 +10,7 @@ import '@vaadin/tabs/theme/material/vaadin-tabs.js'
import '@vaadin/avatar' import '@vaadin/avatar'
import '@vaadin/grid' import '@vaadin/grid'
import '@vaadin/grid/vaadin-grid-filter-column.js' import '@vaadin/grid/vaadin-grid-filter-column.js'
import {get, translate} from '../../../../core/translate/index.js' import {get, translate} from '../../../../core/translate'
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent }) const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })

2
plugins/plugins/core/components/ChatGroupsModal.js

@ -1,5 +1,5 @@
import {css, html, LitElement} from 'lit'; import {css, html, LitElement} from 'lit';
import {translate,} from '../../../../core/translate/index.js' import {translate,} from '../../../../core/translate'
import '@material/mwc-menu'; import '@material/mwc-menu';
import '@material/mwc-list/mwc-list-item.js'; import '@material/mwc-list/mwc-list-item.js';
import '@material/mwc-dialog' import '@material/mwc-dialog'

8
plugins/plugins/core/components/ChatImage.js

@ -1,5 +1,5 @@
import {css, html, LitElement} from 'lit'; import {css, html, LitElement} from 'lit';
import {get, translate,} from '../../../../core/translate/index.js' import {get, translate,} from '../../../../core/translate'
import axios from 'axios' import axios from 'axios'
import {RequestQueueWithPromise} from '../../utils/queue'; import {RequestQueueWithPromise} from '../../utils/queue';
import '@material/mwc-menu'; import '@material/mwc-menu';
@ -231,11 +231,9 @@ getMyNode(){
} }
shouldUpdate(changedProperties) { shouldUpdate(changedProperties) {
if (changedProperties.has('setOpenDialogImage') && changedProperties.size === 1) { return !(changedProperties.has('setOpenDialogImage') && changedProperties.size === 1);
return false;
}
return true
} }

2
plugins/plugins/core/components/ChatLeaveGroup.js

@ -5,7 +5,7 @@ import '@material/mwc-dialog'
import '@polymer/paper-spinner/paper-spinner-lite.js' import '@polymer/paper-spinner/paper-spinner-lite.js'
import '@material/mwc-icon' import '@material/mwc-icon'
import './WrapperModal' import './WrapperModal'
import {get, translate} from '../../../../core/translate/index.js' import {get, translate} from '../../../../core/translate'
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent }) const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })

2
plugins/plugins/core/components/ChatModals.js

@ -1,7 +1,7 @@
import {css, html, LitElement} from 'lit' import {css, html, LitElement} from 'lit'
import {Epml} from '../../../epml' import {Epml} from '../../../epml'
import snackbar from './snackbar.js' import snackbar from './snackbar.js'
import {get, translate} from '../../../../core/translate/index.js' import {get, translate} from '../../../../core/translate'
import '@material/mwc-button' import '@material/mwc-button'
import '@material/mwc-dialog' import '@material/mwc-dialog'

24
plugins/plugins/core/components/ChatPage.js

@ -1,7 +1,7 @@
import {html, LitElement} from 'lit' import {html, LitElement} from 'lit'
import {animate} from '@lit-labs/motion' import {animate} from '@lit-labs/motion'
import {Epml} from '../../../epml.js' import {Epml} from '../../../epml.js'
import {get, translate} from '../../../../core/translate/index.js' import {get, translate} from '../../../../core/translate'
import {Editor, Extension, generateHTML} from '@tiptap/core' import {Editor, Extension, generateHTML} from '@tiptap/core'
import {unsafeHTML} from 'lit/directives/unsafe-html.js' import {unsafeHTML} from 'lit/directives/unsafe-html.js'
import {escape} from 'html-escaper' import {escape} from 'html-escaper'
@ -263,11 +263,11 @@ class ChatPage extends LitElement {
} }
_toggle(value) { _toggle(value) {
this.shifted = value === (false || true) ? value : !this.shifted this.shifted = value === true ? value : !this.shifted
this.requestUpdate() this.requestUpdate()
} }
_toggleResources(value) { _toggleResources(value) {
this.shiftedResources = value === (false || true) ? value : !this.shiftedResources this.shiftedResources = value === true ? value : !this.shiftedResources
this.requestUpdate() this.requestUpdate()
} }
@ -1114,7 +1114,7 @@ class ChatPage extends LitElement {
if (blobFound) { if (blobFound) {
this.insertFile(blobFound) this.insertFile(blobFound)
e.preventDefault(); e.preventDefault();
return
} else { } else {
const item_list = await navigator.clipboard.read() const item_list = await navigator.clipboard.read()
let image_type let image_type
@ -1140,7 +1140,7 @@ class ChatPage extends LitElement {
parentEpml.request('showSnackBar', `${errorMsg}`) parentEpml.request('showSnackBar', `${errorMsg}`)
} }
} else { } else {
return
} }
} }
} }
@ -1279,16 +1279,16 @@ class ChatPage extends LitElement {
if(file.identifier){ if(file.identifier){
this.imageFile = file this.imageFile = file
this.currentEditor = 'newChat' this.currentEditor = 'newChat'
return
}else }else
if (file.type.includes('image')) { if (file.type.includes('image')) {
this.imageFile = file this.imageFile = file
this.currentEditor = 'newChat' this.currentEditor = 'newChat'
return
} else { } else {
this.attachment = file this.attachment = file
this.currentEditor = "newAttachmentChat" this.currentEditor = "newAttachmentChat"
return
} }
} }
@ -1494,11 +1494,9 @@ class ChatPage extends LitElement {
if (changedProperties.has('setActiveChatHeadUrl')) { if (changedProperties.has('setActiveChatHeadUrl')) {
return false return false
} }
if (changedProperties.has('setOpenPrivateMessage')) { return !changedProperties.has('setOpenPrivateMessage');
return false
}
return true
} }
@ -3125,7 +3123,7 @@ class ChatPage extends LitElement {
} catch (error) { } catch (error) {
this.isLoading = false this.isLoading = false
this.isUploadingImage = false this.isUploadingImage = false
return
} }
} }

2
plugins/plugins/core/components/ChatRightPanel.js

@ -217,7 +217,7 @@ class ChatRightPanel extends LitElement {
observerHandler(entries) { observerHandler(entries) {
if (!entries[0].isIntersecting) { if (!entries[0].isIntersecting) {
return
} else { } else {
if(this.groupMembers.length < 20){ if(this.groupMembers.length < 20){
return return

16
plugins/plugins/core/components/ChatRightPanelResources.js

@ -11,7 +11,7 @@ import './TipUser';
import './UserInfo/UserInfo'; import './UserInfo/UserInfo';
import './ChatImage'; import './ChatImage';
import './ReusableImage'; import './ReusableImage';
import {get, translate,} from '../../../../core/translate/index.js' import {get, translate,} from '../../../../core/translate'
import {generateIdFromAddresses} from '../../utils/id-generation'; import {generateIdFromAddresses} from '../../utils/id-generation';
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent }); const parentEpml = new Epml({ type: 'WINDOW', source: window.parent });
@ -307,7 +307,7 @@ class ChatRightPanelResources extends LitElement {
observerHandler(entries) { observerHandler(entries) {
if (!entries[0].isIntersecting) { if (!entries[0].isIntersecting) {
return;
} else { } else {
if (this.images.length < 20) { if (this.images.length < 20) {
return; return;
@ -317,19 +317,11 @@ class ChatRightPanelResources extends LitElement {
} }
selectAuto(e) { selectAuto(e) {
if (e.target.checked) { this.autoView = !e.target.checked;
this.autoView = false
} else {
this.autoView = true
}
} }
selectMyImages(e) { selectMyImages(e) {
if (e.target.checked) { this.onlyMyImages = !e.target.checked;
this.onlyMyImages = false
} else {
this.onlyMyImages = true
}
} }
render() { render() {

26
plugins/plugins/core/components/ChatScroller.js

@ -1,6 +1,6 @@
import {html, LitElement,} from 'lit'; import {html, LitElement,} from 'lit';
import {repeat} from 'lit/directives/repeat.js'; import {repeat} from 'lit/directives/repeat.js';
import {get, translate,} from '../../../../core/translate/index.js' import {get, translate,} from '../../../../core/translate'
import {unsafeHTML} from 'lit/directives/unsafe-html.js'; import {unsafeHTML} from 'lit/directives/unsafe-html.js';
import {chatStyles} from './ChatScroller-css.js'; import {chatStyles} from './ChatScroller-css.js';
import {Epml} from '../../../epml'; import {Epml} from '../../../epml';
@ -676,13 +676,9 @@ class ChatScroller extends LitElement {
isLastMessageBeforeUnread(message, formattedMessages) { isLastMessageBeforeUnread(message, formattedMessages) {
// if the message is the last one in the older messages list and its timestamp is before the user's last seen timestamp // if the message is the last one in the older messages list and its timestamp is before the user's last seen timestamp
if ( return message.timestamp < this.lastReadMessageTimestamp &&
message.timestamp < this.lastReadMessageTimestamp && formattedMessages.indexOf(message) === formattedMessages.length - 21;
formattedMessages.indexOf(message) === formattedMessages.length - 21
) {
return true;
}
return false;
} }
render() { render() {
@ -1097,11 +1093,7 @@ class MessageTemplate extends LitElement {
} }
showBlockIconFunc(bool) { showBlockIconFunc(bool) {
if (bool) { this.showBlockAddressIcon = !!bool;
this.showBlockAddressIcon = true;
} else {
this.showBlockAddressIcon = false;
}
} }
async downloadAttachment(attachment) { async downloadAttachment(attachment) {
@ -1206,10 +1198,8 @@ class MessageTemplate extends LitElement {
if (changedProperties.has('openDialogGif')) { if (changedProperties.has('openDialogGif')) {
return true; return true;
} }
if (changedProperties.has('isGifLoaded')) { return !!changedProperties.has('isGifLoaded');
return true;
}
return false;
} }
clearConsole() { clearConsole() {
@ -2535,4 +2525,4 @@ class ChatMenu extends LitElement {
} }
} }
window.customElements.define('chat-menu', ChatMenu); window.customElements.define('chat-menu', ChatMenu);

2
plugins/plugins/core/components/ChatSeachResults.js

@ -1,6 +1,6 @@
import {html, LitElement} from 'lit'; import {html, LitElement} from 'lit';
import {chatSearchResultsStyles} from './ChatSearchResults-css.js' import {chatSearchResultsStyles} from './ChatSearchResults-css.js'
import {translate} from '../../../../core/translate/index.js' import {translate} from '../../../../core/translate'
export class ChatSearchResults extends LitElement { export class ChatSearchResults extends LitElement {
static get properties() { static get properties() {

2
plugins/plugins/core/components/ChatSearchResults.js

@ -1,6 +1,6 @@
import {html, LitElement} from 'lit' import {html, LitElement} from 'lit'
import {chatSearchResultsStyles} from './ChatSearchResults-css.js' import {chatSearchResultsStyles} from './ChatSearchResults-css.js'
import {translate} from '../../../../core/translate/index.js' import {translate} from '../../../../core/translate'
import '@vaadin/icon' import '@vaadin/icon'
import '@vaadin/icons' import '@vaadin/icons'

6
plugins/plugins/core/components/ChatSelect.js

@ -210,11 +210,9 @@ class ChatSelect extends LitElement {
if(changedProperties.has('activeChatHeadUrl')){ if(changedProperties.has('activeChatHeadUrl')){
return true return true
} }
if(changedProperties.has('chatInfo')){ return !!changedProperties.has('chatInfo');
return true
}
return false
} }
getUrl(chatUrl) { getUrl(chatUrl) {

6
plugins/plugins/core/components/ChatSideNavHeads.js

@ -185,11 +185,9 @@ class ChatSideNavHeads extends LitElement {
if(changedProperties.has('chatInfo')){ if(changedProperties.has('chatInfo')){
return true return true
} }
if(changedProperties.has('isImageLoaded')){ return !!changedProperties.has('isImageLoaded');
return true
}
return false
} }
getUrl(chatUrl) { getUrl(chatUrl) {

10
plugins/plugins/core/components/ChatTextEditor copy.js

@ -3,7 +3,7 @@ import {escape, unescape} from 'html-escaper'
import {EmojiPicker} from 'emoji-picker-js' import {EmojiPicker} from 'emoji-picker-js'
import {inputKeyCodes} from '../../utils/keyCodes.js' import {inputKeyCodes} from '../../utils/keyCodes.js'
import {Epml} from '../../../epml.js' import {Epml} from '../../../epml.js'
import {get} from '../../../../core/translate/index.js' import {get} from '../../../../core/translate'
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent }) const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
@ -268,7 +268,7 @@ class ChatTextEditor extends LitElement {
if (!this.userName) { if (!this.userName) {
e.preventDefault(); e.preventDefault();
parentEpml.request('showSnackBar', get("chatpage.cchange27")); parentEpml.request('showSnackBar', get("chatpage.cchange27"));
}; }
} }
initialChat(e) { initialChat(e) {
@ -360,15 +360,15 @@ class ChatTextEditor extends LitElement {
shouldUpdate(changedProperties) { shouldUpdate(changedProperties) {
// Only update element if prop1 changed. // Only update element if prop1 changed.
if(changedProperties.has('setChatEditor') && changedProperties.size === 1) return false return !(changedProperties.has('setChatEditor') && changedProperties.size === 1);
return true
} }
sendMessageFunc(props) { sendMessageFunc(props) {
if (this.chatMessageSize > 1000 ) { if (this.chatMessageSize > 1000 ) {
parentEpml.request('showSnackBar', get("chatpage.cchange29")) parentEpml.request('showSnackBar', get("chatpage.cchange29"))
return return
}; }
this.chatMessageSize = 0 this.chatMessageSize = 0
this.chatEditor.updateMirror() this.chatEditor.updateMirror()
this._sendMessage(props) this._sendMessage(props)

11
plugins/plugins/core/components/ChatTextEditor.js

@ -3,7 +3,7 @@ import {EmojiPicker} from 'emoji-picker-js'
import {Epml} from '../../../epml.js' import {Epml} from '../../../epml.js'
import '@material/mwc-icon' import '@material/mwc-icon'
import '@material/mwc-checkbox' import '@material/mwc-checkbox'
import {get, translate} from '../../../../core/translate/index.js' import {get, translate} from '../../../../core/translate'
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent }) const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
@ -358,10 +358,9 @@ class ChatTextEditor extends LitElement {
.hide-styling { .hide-styling {
display: none; display: none;
} }
mwc-checkbox::shadow .mdc-checkbox::after, mwc-checkbox::shadow .mdc-checkbox::before { mwc-checkbox::shadow, mdc-checkbox::after, mwc-checkbox::shadow, mdc-checkbox::before {
background-color:var(--mdc-theme-primary) background-color: var(--mdc-theme-primary)
} }
--mdc-checkbox-unchecked-color
` `
} }
@ -665,8 +664,8 @@ mwc-checkbox::shadow .mdc-checkbox::after, mwc-checkbox::shadow .mdc-checkbox::b
shouldUpdate(changedProperties) { shouldUpdate(changedProperties) {
// Only update element if prop1 changed. // Only update element if prop1 changed.
if(changedProperties.has('setChatEditor') && changedProperties.size === 1) return false return !(changedProperties.has('setChatEditor') && changedProperties.size === 1);
return true
} }
sendMessageFunc(props) { sendMessageFunc(props) {

10
plugins/plugins/core/components/ChatWelcomePage.js

@ -1,6 +1,6 @@
import {css, html, LitElement} from 'lit' import {css, html, LitElement} from 'lit'
import {Epml} from '../../../epml.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 isElectron from 'is-electron'
import '@material/mwc-icon' import '@material/mwc-icon'
@ -145,7 +145,7 @@ class ChatWelcomePage extends LitElement {
} }
h2, h3, h4, h5 { h2, h3, h4, h5 {
color:# var(--black); color: var(--black);
font-weight: 400; font-weight: 400;
} }
@ -369,7 +369,7 @@ class ChatWelcomePage extends LitElement {
myRes = false; myRes = false;
} else { } else {
myRes = myNameRes; myRes = myNameRes;
}; }
return myRes; return myRes;
}; };
@ -379,7 +379,7 @@ class ChatWelcomePage extends LitElement {
recipient = _recipient; recipient = _recipient;
} else { } else {
recipient = myNameRes.owner; recipient = myNameRes.owner;
}; }
let _reference = new Uint8Array(64); let _reference = new Uint8Array(64);
window.crypto.getRandomValues(_reference); window.crypto.getRandomValues(_reference);
@ -411,7 +411,7 @@ class ChatWelcomePage extends LitElement {
isEncrypted = 0; isEncrypted = 0;
_publicKey = this.selectedAddress.address; _publicKey = this.selectedAddress.address;
sendMessageRequest(isEncrypted, _publicKey); sendMessageRequest(isEncrypted, _publicKey);
}; }
}; };
const sendMessageRequest = async (isEncrypted, _publicKey) => { const sendMessageRequest = async (isEncrypted, _publicKey) => {

8
plugins/plugins/core/components/ImageComponent.js

@ -1,5 +1,5 @@
import {css, html, LitElement} from 'lit'; import {css, html, LitElement} from 'lit';
import {translate,} from '../../../../core/translate/index.js' import {translate,} from '../../../../core/translate'
export class ImageComponent extends LitElement { export class ImageComponent extends LitElement {
static get properties() { static get properties() {
@ -78,11 +78,7 @@ export class ImageComponent extends LitElement {
url: data.src, url: data.src,
}; };
this.requestUpdate(); this.requestUpdate();
} else if (!data.ok || data.error) { } else this.error = !data.ok || data.error;
this.error = true;
} else {
this.error = false;
}
} catch (error) { } catch (error) {
this.error = true; this.error = true;
console.error(error); console.error(error);

2
plugins/plugins/core/components/LevelFounder.js

@ -1,6 +1,6 @@
import {css, html, LitElement} from 'lit' import {css, html, LitElement} from 'lit'
import {Epml} from '../../../epml.js' import {Epml} from '../../../epml.js'
import {translate} from '../../../../core/translate/index.js' import {translate} from '../../../../core/translate'
import '@polymer/paper-tooltip/paper-tooltip.js' import '@polymer/paper-tooltip/paper-tooltip.js'
import {RequestQueue} from '../../utils/queue.js' import {RequestQueue} from '../../utils/queue.js'

4
plugins/plugins/core/components/NameMenu.js

@ -1,7 +1,7 @@
import {css, html, LitElement} from 'lit' import {css, html, LitElement} from 'lit'
import {Epml} from '../../../epml.js' import {Epml} from '../../../epml.js'
import snackbar from './snackbar.js' import snackbar from './snackbar.js'
import {get, translate} from '../../../../core/translate/index.js' import {get, translate} from '../../../../core/translate'
import '@material/mwc-snackbar' import '@material/mwc-snackbar'
import '@material/mwc-button' import '@material/mwc-button'
import '@material/mwc-dialog' import '@material/mwc-dialog'
@ -90,7 +90,7 @@ class NameMenu extends LitElement {
} }
h2, h3, h4, h5 { h2, h3, h4, h5 {
color:# var(--black); color: var(--black);
font-weight: 400; font-weight: 400;
} }

4
plugins/plugins/core/components/QRCode.js

@ -207,7 +207,7 @@ var encode = function(ver, mode, data, maxbuflen) {
pack(data[i], 8); pack(data[i], 8);
} }
break; break;
}; }
pack(MODE_TERMINATOR, 4); pack(MODE_TERMINATOR, 4);
if (remaining < 8) buf.push(bits); if (remaining < 8) buf.push(bits);
@ -596,4 +596,4 @@ var QRCode = {
}; };
export { QRCode }; export { QRCode };
export default QRCode; export default QRCode;

2
plugins/plugins/core/components/ReusableImage.js

@ -1,5 +1,5 @@
import {css, html, LitElement} from 'lit' import {css, html, LitElement} from 'lit'
import {translate,} from '../../../../core/translate/index.js' import {translate,} from '../../../../core/translate'
import axios from 'axios' import axios from 'axios'
import {RequestQueueWithPromise} from '../../utils/queue' import {RequestQueueWithPromise} from '../../utils/queue'
import '@material/mwc-menu' import '@material/mwc-menu'

4
plugins/plugins/core/components/TipUser.js

@ -3,7 +3,7 @@ import {tipUserStyles} from './TipUser-css.js'
import {Epml} from '../../../epml' import {Epml} from '../../../epml'
import '@vaadin/button' import '@vaadin/button'
import '@polymer/paper-progress/paper-progress.js' import '@polymer/paper-progress/paper-progress.js'
import {get, translate} from '../../../../core/translate/index.js' import {get, translate} from '../../../../core/translate'
const parentEpml = new Epml({ type: "WINDOW", source: window.parent }); const parentEpml = new Epml({ type: "WINDOW", source: window.parent });
@ -140,7 +140,7 @@ export class TipUser extends LitElement {
}; };
const validateAddress = async (receiverAddress) => { const validateAddress = async (receiverAddress) => {
return await window.parent.validateAddress(receiverAddress); return window.parent.validateAddress(receiverAddress);
}; };
const getName = async (recipient) => { const getName = async (recipient) => {

2
plugins/plugins/core/components/TradeInfoView.js

@ -1,7 +1,7 @@
import {css, html, LitElement} from 'lit' import {css, html, LitElement} from 'lit'
import {render} from 'lit/html.js' import {render} from 'lit/html.js'
import {Epml} from '../../../epml.js' import {Epml} from '../../../epml.js'
import {get, translate} from '../../../../core/translate/index.js' import {get, translate} from '../../../../core/translate'
import {tradeInfoViewStyle} from './TradeInfoView-css.js' import {tradeInfoViewStyle} from './TradeInfoView-css.js'
import './TraderInfoView.js' import './TraderInfoView.js'
import '@polymer/paper-dialog/paper-dialog.js' import '@polymer/paper-dialog/paper-dialog.js'

2
plugins/plugins/core/components/TraderInfoView.js

@ -1,7 +1,7 @@
import {css, html, LitElement} from 'lit' import {css, html, LitElement} from 'lit'
import {render} from 'lit/html.js' import {render} from 'lit/html.js'
import {Epml} from '../../../epml.js' import {Epml} from '../../../epml.js'
import {get, translate} from '../../../../core/translate/index.js' import {get, translate} from '../../../../core/translate'
import '@polymer/paper-dialog/paper-dialog.js' import '@polymer/paper-dialog/paper-dialog.js'
import '@material/mwc-button' import '@material/mwc-button'

8
plugins/plugins/core/components/UserInfo/UserInfo.js

@ -1,5 +1,5 @@
import {html, LitElement} from 'lit' import {html, LitElement} from 'lit'
import {translate} from '../../../../../core/translate/index.js' import {translate} from '../../../../../core/translate'
import {userInfoStyles} from './UserInfo-css.js' import {userInfoStyles} from './UserInfo-css.js'
import {cropAddress} from '../../../utils/cropAddress.js' import {cropAddress} from '../../../utils/cropAddress.js'
@ -118,13 +118,13 @@ export class UserInfo extends LitElement {
this.openProfile() this.openProfile()
}, 250); }, 250);
this.setOpenUserInfo(false) this.setOpenUserInfo(false)
}}> }}>
${translate("profile.profile18")} ${translate("profile.profile18")}
</div> </div>
` : ''} ` : ''}
</div> </div>
` `
} }

2
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-button'
import '@material/mwc-icon' import '@material/mwc-icon'
import {translate} from '../../../../core/translate/index.js' import {translate} from '../../../../core/translate'
class FragFileInput extends LitElement { class FragFileInput extends LitElement {
static get properties () { static get properties () {

2
plugins/plugins/core/components/qortal-info-view.js

@ -1,6 +1,6 @@
import {css, html, LitElement} from 'lit' import {css, html, LitElement} from 'lit'
import {render} from 'lit/html.js' 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 '@polymer/paper-dialog/paper-dialog.js'
import '@material/mwc-button' import '@material/mwc-button'
import '@material/mwc-icon' import '@material/mwc-icon'

2
plugins/plugins/core/components/time-elements/extended-time-element.js

@ -75,7 +75,7 @@ export default class ExtendedTimeElement extends HTMLElement {
} }
} }
getFormattedDate() { getFormattedDate() {
return;
} }
} }
const titleFormatter = makeFormatter({ const titleFormatter = makeFormatter({

2
plugins/plugins/core/components/time-elements/index.js

@ -240,7 +240,7 @@ class ExtendedTimeElement extends HTMLElement {
} }
} }
getFormattedDate() { getFormattedDate() {
return;
} }
} }
const titleFormatter = makeFormatter({ const titleFormatter = makeFormatter({

8
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 {render} from 'lit/html.js'
import {Epml} from '../../../epml.js' import {Epml} from '../../../epml.js'
import isElectron from 'is-electron' 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 '../components/time-elements/index.js'
import '@material/mwc-button' import '@material/mwc-button'
import '@material/mwc-dialog' import '@material/mwc-dialog'
@ -2491,7 +2491,7 @@ class GroupManagement extends LitElement {
}) })
if (this.bannedMembers.length === 0) { if (this.bannedMembers.length === 0) {
return
} else { } else {
this.bannedMembers.map(a => { this.bannedMembers.map(a => {
let callTheBannedMember = a.offender let callTheBannedMember = a.offender
@ -2542,7 +2542,7 @@ class GroupManagement extends LitElement {
}) })
if (this.groupInviteMembers.length === 0) { if (this.groupInviteMembers.length === 0) {
return
} else { } else {
this.groupInviteMembers.map(a => { this.groupInviteMembers.map(a => {
let callTheInviteMember = a.invitee let callTheInviteMember = a.invitee
@ -2589,7 +2589,7 @@ class GroupManagement extends LitElement {
}) })
if (this.groupJoinMembers.length === 0) { if (this.groupJoinMembers.length === 0) {
return
} else { } else {
this.groupJoinMembers.map(a => { this.groupJoinMembers.map(a => {
let callTheJoinMember = a.joiner let callTheJoinMember = a.joiner

4
plugins/plugins/core/messaging/q-chat/q-chat.src.js

@ -938,7 +938,7 @@ class Chat extends LitElement {
getChatHeadFromState(chatObj) { getChatHeadFromState(chatObj) {
if (chatObj === undefined) { if (chatObj === undefined) {
return
} else { } else {
this.chatHeadsObj = chatObj this.chatHeadsObj = chatObj
this.setChatHeads(chatObj) this.setChatHeads(chatObj)
@ -986,4 +986,4 @@ class Chat extends LitElement {
} }
} }
window.customElements.define('q-chat', Chat) window.customElements.define('q-chat', Chat)

2
plugins/plugins/core/minting/minting-info.src.js

@ -1,7 +1,7 @@
import {css, html, LitElement} from 'lit' import {css, html, LitElement} from 'lit'
import {Epml} from '../../../epml.js' import {Epml} from '../../../epml.js'
import isElectron from 'is-electron' 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-icon'
import '@material/mwc-button' import '@material/mwc-button'
import '@material/mwc-dialog' import '@material/mwc-dialog'

2
plugins/plugins/core/name-registration/name-registration.src.js

@ -1,7 +1,7 @@
import {css, html, LitElement} from 'lit' import {css, html, LitElement} from 'lit'
import {render} from 'lit/html.js' import {render} from 'lit/html.js'
import {Epml} from '../../../epml.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 isElectron from 'is-electron'
import '@material/mwc-button' import '@material/mwc-button'
import '@material/mwc-dialog' import '@material/mwc-dialog'

2
plugins/plugins/core/names-market/names-market.src.js

@ -1,7 +1,7 @@
import {css, html, LitElement} from 'lit' import {css, html, LitElement} from 'lit'
import {render} from 'lit/html.js' import {render} from 'lit/html.js'
import {Epml} from '../../../epml.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 isElectron from 'is-electron'
import '../components/qortal-info-view.js' import '../components/qortal-info-view.js'
import '@material/mwc-button' import '@material/mwc-button'

2
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 {render} from 'lit/html.js'
import {Epml} from '../../../epml.js' import {Epml} from '../../../epml.js'
import isElectron from 'is-electron' 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 '@polymer/paper-spinner/paper-spinner-lite.js'
import '@material/mwc-icon' import '@material/mwc-icon'
import '@material/mwc-textfield' import '@material/mwc-textfield'

18
plugins/plugins/core/overview-page/overview-page.src.js

@ -1,6 +1,6 @@
import {css, html, LitElement} from 'lit' import {css, html, LitElement} from 'lit'
import {Epml} from '../../../epml.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 {overviewStyle} from './overview-page-css.js' import {overviewStyle} from './overview-page-css.js'
import {asyncReplace} from 'lit/directives/async-replace.js' import {asyncReplace} from 'lit/directives/async-replace.js'
import isElectron from 'is-electron' import isElectron from 'is-electron'
@ -247,17 +247,9 @@ class OverviewPage extends LitElement {
const findMyMintingRecipient = this.listAccounts.find((myKey) => myKey.recipientAccount === address) const findMyMintingRecipient = this.listAccounts.find((myKey) => myKey.recipientAccount === address)
const findRemovedSponsorsKey = this.listAccounts.filter((my) => my.address) const findRemovedSponsorsKey = this.listAccounts.filter((my) => my.address)
if (findMyMintingAccount === undefined) { this.check1 = findMyMintingAccount !== undefined;
this.check1 = false
} else {
this.check1 = true
}
if (findMyMintingRecipient === undefined) { this.check2 = findMyMintingRecipient !== undefined;
this.check2 = false
} else {
this.check2 = true
}
if (findRemovedSponsorsKey.length > 0) { if (findRemovedSponsorsKey.length > 0) {
this.removeBlankKey(findRemovedSponsorsKey.publicKey) this.removeBlankKey(findRemovedSponsorsKey.publicKey)
@ -611,7 +603,7 @@ class StartMintingNow extends LitElement {
this.getMintingAcccounts() this.getMintingAcccounts()
} catch (error) { } catch (error) {
this.errorMsg = this.renderErrorMsg3() this.errorMsg = this.renderErrorMsg3()
return
} }
} }
@ -732,7 +724,7 @@ class StartMintingNow extends LitElement {
this.confirmRelationship(publicAddress) this.confirmRelationship(publicAddress)
} catch (error) { } catch (error) {
this.errorMsg = error.data.message || this.renderErrorMsg4() this.errorMsg = error.data.message || this.renderErrorMsg4()
return
} }
} }

2
plugins/plugins/core/puzzles/puzzles.src.js

@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit'
import {render} from 'lit/html.js' import {render} from 'lit/html.js'
import {Epml} from '../../../epml.js' import {Epml} from '../../../epml.js'
import isElectron from 'is-electron' 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 nacl from '../../../../crypto/api/deps/nacl-fast.js'
import Base58 from '../../../../crypto/api/deps/Base58.js' import Base58 from '../../../../crypto/api/deps/Base58.js'
import publicKeyToAddress from '../../../../crypto/api/wallet/publicKeyToAddress.js' import publicKeyToAddress from '../../../../crypto/api/wallet/publicKeyToAddress.js'

2
plugins/plugins/core/q-app/q-apps.src.js

@ -1,7 +1,7 @@
import {css, html, LitElement} from 'lit' import {css, html, LitElement} from 'lit'
import {render} from 'lit/html.js' import {render} from 'lit/html.js'
import {Epml} from '../../../epml.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 isElectron from 'is-electron'
import '@polymer/paper-spinner/paper-spinner-lite.js' import '@polymer/paper-spinner/paper-spinner-lite.js'
import '@polymer/paper-dialog/paper-dialog.js' import '@polymer/paper-dialog/paper-dialog.js'

6
plugins/plugins/core/qdn/browser/browser.src.js

@ -1,7 +1,7 @@
import { css, html, LitElement } from 'lit' import { css, html, LitElement } from 'lit'
import { Epml } from '../../../../epml' import { Epml } from '../../../../epml'
import isElectron from 'is-electron' 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 ShortUniqueId from 'short-unique-id';
import FileSaver from 'file-saver' import FileSaver from 'file-saver'
import * as actions from '../../components/qdn-action-types' import * as actions from '../../components/qdn-action-types'
@ -1547,7 +1547,6 @@ class WebBrowser extends LitElement {
reason: errorMsg, reason: errorMsg,
identifier: resource.identifier identifier: resource.identifier
}) })
continue
} }
} catch (error) { } catch (error) {
@ -1555,7 +1554,6 @@ class WebBrowser extends LitElement {
reason: "Unknown error", reason: "Unknown error",
identifier: resource.identifier identifier: resource.identifier
}) })
continue
} }
@ -4164,7 +4162,7 @@ async function showModalAndWait(type, data) {
const modalContent = modal.querySelector('.modal-content') const modalContent = modal.querySelector('.modal-content')
modalContent.addEventListener('click', (e) => { modalContent.addEventListener('click', (e) => {
e.stopPropagation() e.stopPropagation()
return
}) })
const backdropClick = document.getElementById('backdrop') const backdropClick = document.getElementById('backdrop')
backdropClick.addEventListener('click', () => { backdropClick.addEventListener('click', () => {

2
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 {render} from 'lit/html.js'
import {Epml} from '../../../../epml' import {Epml} from '../../../../epml'
import isElectron from 'is-electron' 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-button'
import '@material/mwc-dialog' import '@material/mwc-dialog'
import '@material/mwc-icon' import '@material/mwc-icon'

2
plugins/plugins/core/qdn/publish/publish.src.js

@ -1,7 +1,7 @@
import {css, html, LitElement} from 'lit' import {css, html, LitElement} from 'lit'
import {Epml} from '../../../../epml' import {Epml} from '../../../../epml'
import isElectron from 'is-electron' 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-button'
import '@material/mwc-textfield' import '@material/mwc-textfield'
import '@material/mwc-select' import '@material/mwc-select'

2
plugins/plugins/core/qdn/websites.src.js

@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit'
import {render} from 'lit/html.js' import {render} from 'lit/html.js'
import {Epml} from '../../../epml.js' import {Epml} from '../../../epml.js'
import isElectron from 'is-electron' 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-dialog'
import '@material/mwc-icon' import '@material/mwc-icon'
import '@material/mwc-button' import '@material/mwc-button'

190
plugins/plugins/core/qortal-lottery/qortal-lottery.src.js

@ -1,7 +1,7 @@
import {css, html, LitElement} from 'lit' import {css, html, LitElement} from 'lit'
import {render} from 'lit/html.js' import {render} from 'lit/html.js'
import {Epml} from '../../../epml.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 isElectron from 'is-electron'
import '@material/mwc-button' import '@material/mwc-button'
import '@material/mwc-dialog' import '@material/mwc-dialog'
@ -480,20 +480,20 @@ class QortalLottery extends LitElement {
}) })
}) })
await this.openLotteries.map(item => { this.openLotteries.map(item => {
const aTT = item.ATAddress const aTT = item.ATAddress
const endHeight = item.sleepUntilHeight const endHeight = item.sleepUntilHeight
const newObj = { const newObj = {
ATAddress: aTT, ATAddress: aTT,
sleepUntilHeight: endHeight sleepUntilHeight: endHeight
} }
this.openLotteriesAtArray.push(newObj) this.openLotteriesAtArray.push(newObj)
}) })
await this.closedLotteries.map(item => { this.closedLotteries.map(item => {
const myAT = item.ATAddress const myAT = item.ATAddress
this.closedLotteriesAtArray.push(myAT) this.closedLotteriesAtArray.push(myAT)
}) })
const appDelay = ms => new Promise(res => setTimeout(res, ms)) const appDelay = ms => new Promise(res => setTimeout(res, ms))
await appDelay(1000) await appDelay(1000)
@ -502,37 +502,37 @@ class QortalLottery extends LitElement {
async getOpenLotteries() { async getOpenLotteries() {
let prepareOpenLotteriesArray = [] let prepareOpenLotteriesArray = []
await this.openLotteriesAtArray.map(item => { this.openLotteriesAtArray.map(item => {
parentEpml.request('apiCall', { parentEpml.request('apiCall', {
url: `/transactions/address/${item.ATAddress}?limit=0&reverse=true` url: `/transactions/address/${item.ATAddress}?limit=0&reverse=true`
}).then(res => { }).then(res => {
this.openLotteriesFilterTx1 = [] this.openLotteriesFilterTx1 = []
this.openLotteriesFilterTx2 = [] this.openLotteriesFilterTx2 = []
this.openLotteriesFilterTx = res.filter(function (da) { this.openLotteriesFilterTx = res.filter(function (da) {
return da.type === "DEPLOY_AT" return da.type === "DEPLOY_AT"
}) })
this.openLotteriesFilterTx2 = res.filter(function (pm) { this.openLotteriesFilterTx2 = res.filter(function (pm) {
return pm.type === "PAYMENT" return pm.type === "PAYMENT"
}) })
this.openLotteriesFilterTx.map(item2 => { this.openLotteriesFilterTx.map(item2 => {
const sleep = item.sleepUntilHeight const sleep = item.sleepUntilHeight
const desc = item2.description const desc = item2.description
const start = item2.blockHeight const start = item2.blockHeight
const ata = item2.aTAddress const ata = item2.aTAddress
const amount = item2.tags const amount = item2.tags
const players = this.openLotteriesFilterTx2.length const players = this.openLotteriesFilterTx2.length
const obj = { const obj = {
description: desc, description: desc,
startBlock: start, startBlock: start,
endBlock: sleep, endBlock: sleep,
aTAddress: ata, aTAddress: ata,
joined: players, joined: players,
enter: amount enter: amount
} }
prepareOpenLotteriesArray.push(obj) prepareOpenLotteriesArray.push(obj)
}) })
}) })
}) })
const appDelay = ms => new Promise(res => setTimeout(res, ms)) const appDelay = ms => new Promise(res => setTimeout(res, ms))
await appDelay(2000) await appDelay(2000)
this.openLotteriesArray = prepareOpenLotteriesArray this.openLotteriesArray = prepareOpenLotteriesArray
@ -543,55 +543,55 @@ class QortalLottery extends LitElement {
async getFinishedLotteries() { async getFinishedLotteries() {
let prepareClosedLotteriesArray = [] let prepareClosedLotteriesArray = []
await this.closedLotteriesAtArray.map(item => { this.closedLotteriesAtArray.map(item => {
parentEpml.request('apiCall', { parentEpml.request('apiCall', {
url: `/transactions/address/${item}?limit=0&reverse=true` url: `/transactions/address/${item}?limit=0&reverse=true`
}).then(res => { }).then(res => {
this.closedLotteriesFilterTx1 = [] this.closedLotteriesFilterTx1 = []
this.closedLotteriesFilterTx2 = [] this.closedLotteriesFilterTx2 = []
this.closedLotteriesFilterTx1 = res.filter(function (el) { this.closedLotteriesFilterTx1 = res.filter(function (el) {
return el.type === "DEPLOY_AT" return el.type === "DEPLOY_AT"
}) })
this.closedLotteriesFilterTx2 = res.filter(function (el) { this.closedLotteriesFilterTx2 = res.filter(function (el) {
return el.type === "AT" return el.type === "AT"
}) })
this.closedLotteriesFilterTx2.map(item1 => { this.closedLotteriesFilterTx2.map(item1 => {
const twinner = item1.recipient const twinner = item1.recipient
const tjackpot = item1.amount const tjackpot = item1.amount
const tendblock = item1.blockHeight const tendblock = item1.blockHeight
this.closedLotteriesFilterTx1.map(item2 => { this.closedLotteriesFilterTx1.map(item2 => {
const tstartblock = item2.blockHeight const tstartblock = item2.blockHeight
const tdescription = item2.description const tdescription = item2.description
parentEpml.request('apiCall', { parentEpml.request('apiCall', {
url: `/names/address/${twinner}?limit=0&reverse=true` url: `/names/address/${twinner}?limit=0&reverse=true`
}).then(res => { }).then(res => {
if (res.length) { if (res.length) {
const winName = res[0].name const winName = res[0].name
const obj = { const obj = {
description: tdescription, description: tdescription,
startblock: tstartblock, startblock: tstartblock,
endblock: tendblock, endblock: tendblock,
winner: winName, winner: winName,
jackpot: tjackpot jackpot: tjackpot
} }
prepareClosedLotteriesArray.push(obj) prepareClosedLotteriesArray.push(obj)
} else { } else {
const winName = twinner const winName = twinner
const obj = { const obj = {
description: tdescription, description: tdescription,
startblock: tstartblock, startblock: tstartblock,
endblock: tendblock, endblock: tendblock,
winner: winName, winner: winName,
jackpot: tjackpot jackpot: tjackpot
} }
prepareClosedLotteriesArray.push(obj) prepareClosedLotteriesArray.push(obj)
} }
}) })
}) })
}) })
}) })
}) })
const appDelay = ms => new Promise(res => setTimeout(res, ms)) const appDelay = ms => new Promise(res => setTimeout(res, ms))
await appDelay(5000) await appDelay(5000)
this.closedLotteriesArray = prepareClosedLotteriesArray this.closedLotteriesArray = prepareClosedLotteriesArray

2
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 {render} from 'lit/html.js'
import {Epml} from '../../../epml.js' import {Epml} from '../../../epml.js'
import isElectron from 'is-electron' 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-icon'
import '@material/mwc-button' import '@material/mwc-button'
import '@material/mwc-textfield' import '@material/mwc-textfield'

6
plugins/plugins/core/sponsorship-list/sponsorship-list.src.js

@ -1,6 +1,6 @@
import {html, LitElement} from 'lit' import {html, LitElement} from 'lit'
import {Epml} from '../../../epml.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 {blocksNeed} from '../../utils/blocks-needed.js' import {blocksNeed} from '../../utils/blocks-needed.js'
import {asyncReplace} from 'lit/directives/async-replace.js' import {asyncReplace} from 'lit/directives/async-replace.js'
import {pageStyles} from './sponsorship-list-css.src.js' import {pageStyles} from './sponsorship-list-css.src.js'
@ -721,13 +721,13 @@ class SponsorshipList extends LitElement {
} }
const getTxnRequestResponse = (txnResponse) => { const getTxnRequestResponse = (txnResponse) => {
const extraData = txnResponse && txnResponse.extraData; const extraData = txnResponse && txnResponse.extraData;
const data = txnResponse && txnResponse.data; const data = txnResponse && txnResponse.data;
const dataMessage = data && data.message; const dataMessage = data && data.message;
const extraDataPrivateKey = extraData && extraData.rewardSharePrivateKey; const extraDataPrivateKey = extraData && extraData.rewardSharePrivateKey;
const txnSuccess = txnResponse && txnResponse.success; const txnSuccess = txnResponse && txnResponse.success;
if (extraDataPrivateKey && typeof dataMessage === 'string' && if (extraDataPrivateKey && typeof dataMessage === 'string' &&
(dataMessage.includes('multiple') || dataMessage.includes('SELF_SHARE_EXISTS'))) { (dataMessage.includes('multiple') || dataMessage.includes('SELF_SHARE_EXISTS'))) {
this.privateRewardShareKey = extraDataPrivateKey; this.privateRewardShareKey = extraDataPrivateKey;

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save