mirror of
https://github.com/Qortal/qortal-ui.git
synced 2025-01-27 13:22:14 +00:00
Cleanup code
This commit is contained in:
parent
1c587325e8
commit
42201341c1
@ -49,8 +49,6 @@ export const testApiKey = async (apiKey) => {
|
||||
let testRes = await api.request(testUrl, {
|
||||
method: "GET"
|
||||
});
|
||||
if (testRes === true) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return testRes === true;
|
||||
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ import { connect } from 'pwa-helpers'
|
||||
import { store } from '../store.js'
|
||||
import { Epml } from '../epml.js'
|
||||
import { addTradeBotRoutes } from '../tradebot/addTradeBotRoutes.js'
|
||||
import { get, translate } from '../../translate/index.js'
|
||||
import { get, translate } from '../../translate'
|
||||
import localForage from 'localforage'
|
||||
import { decryptData, encryptData } from '../lockScreen.js'
|
||||
import { setChatLastSeen } from '../redux/app/app-actions.js'
|
||||
@ -560,7 +560,7 @@ class AppView extends connect(store)(LitElement) {
|
||||
if(el3) {
|
||||
els['checklist'] = el3
|
||||
}
|
||||
|
||||
|
||||
return els
|
||||
}
|
||||
|
||||
@ -965,7 +965,7 @@ class AppView extends connect(store)(LitElement) {
|
||||
await appDelay(1000)
|
||||
|
||||
if (this.isEmptyArray(this.tradeBotAvailableBtcQortal) === true) {
|
||||
return
|
||||
|
||||
} else {
|
||||
const botbtcprice = this.round(parseFloat(this.tradeBotBtcBook[0].botBtcPrice))
|
||||
const changebtcamount = parseFloat(this.tradeBotBtcBook[0].botBtcQortAmount)
|
||||
@ -1009,7 +1009,7 @@ class AppView extends connect(store)(LitElement) {
|
||||
}
|
||||
|
||||
if (this.isEmptyArray(this.tradeBotBtcBook) === true) {
|
||||
return
|
||||
|
||||
} else {
|
||||
const checkBotBtcFunds = this.round(parseFloat(this.tradeBotBtcBook[0].botBtcQortAmount) * parseFloat(this.tradeBotBtcBook[0].botBtcPrice))
|
||||
const myBotBtcFunds = this.round(parseFloat(this.btcWalletBalance))
|
||||
@ -1162,7 +1162,7 @@ class AppView extends connect(store)(LitElement) {
|
||||
await appDelay(1000)
|
||||
|
||||
if (this.isEmptyArray(this.tradeBotAvailableLtcQortal) === true) {
|
||||
return
|
||||
|
||||
} else {
|
||||
const botltcprice = this.round(parseFloat(this.tradeBotLtcBook[0].botLtcPrice))
|
||||
const changeltcamount = parseFloat(this.tradeBotLtcBook[0].botLtcQortAmount)
|
||||
@ -1206,7 +1206,7 @@ class AppView extends connect(store)(LitElement) {
|
||||
}
|
||||
|
||||
if (this.isEmptyArray(this.tradeBotLtcBook) === true) {
|
||||
return
|
||||
|
||||
} else {
|
||||
const checkBotLtcFunds = this.round(parseFloat(this.tradeBotLtcBook[0].botLtcQortAmount) * parseFloat(this.tradeBotLtcBook[0].botLtcPrice))
|
||||
const myBotLtcFunds = this.round(parseFloat(this.ltcWalletBalance))
|
||||
@ -1348,7 +1348,7 @@ class AppView extends connect(store)(LitElement) {
|
||||
await appDelay(1000)
|
||||
|
||||
if (this.isEmptyArray(this.tradeBotAvailableDogeQortal) === true) {
|
||||
return
|
||||
|
||||
} else {
|
||||
const botdogeprice = this.round(parseFloat(this.tradeBotDogeBook[0].botDogePrice))
|
||||
const changedogeamount = parseFloat(this.tradeBotDogeBook[0].botDogeQortAmount)
|
||||
@ -1392,7 +1392,7 @@ class AppView extends connect(store)(LitElement) {
|
||||
}
|
||||
|
||||
if (this.isEmptyArray(this.tradeBotDogeBook) === true) {
|
||||
return
|
||||
|
||||
} else {
|
||||
const checkBotDogeFunds = this.round(parseFloat(this.tradeBotDogeBook[0].botDogeQortAmount) * parseFloat(this.tradeBotDogeBook[0].botDogePrice))
|
||||
const myBotDogeFunds = this.round(parseFloat(this.dogeWalletBalance))
|
||||
@ -1534,7 +1534,7 @@ class AppView extends connect(store)(LitElement) {
|
||||
await appDelay(1000)
|
||||
|
||||
if (this.isEmptyArray(this.tradeBotAvailableDgbQortal) === true) {
|
||||
return
|
||||
|
||||
} else {
|
||||
const botdgbprice = this.round(parseFloat(this.tradeBotDgbBook[0].botDgbPrice))
|
||||
const changedgbamount = parseFloat(this.tradeBotDgbBook[0].botDgbQortAmount)
|
||||
@ -1578,7 +1578,7 @@ class AppView extends connect(store)(LitElement) {
|
||||
}
|
||||
|
||||
if (this.isEmptyArray(this.tradeBotDgbBook) === true) {
|
||||
return
|
||||
|
||||
} else {
|
||||
const checkBotDgbFunds = this.round(parseFloat(this.tradeBotDgbBook[0].botDgbQortAmount) * parseFloat(this.tradeBotDgbBook[0].botDgbPrice))
|
||||
const myBotDgbFunds = this.round(parseFloat(this.dgbWalletBalance))
|
||||
@ -1720,7 +1720,7 @@ class AppView extends connect(store)(LitElement) {
|
||||
await appDelay(1000)
|
||||
|
||||
if (this.isEmptyArray(this.tradeBotAvailableRvnQortal) === true) {
|
||||
return
|
||||
|
||||
} else {
|
||||
const botrvnprice = this.round(parseFloat(this.tradeBotRvnBook[0].botRvnPrice))
|
||||
const changervnamount = parseFloat(this.tradeBotRvnBook[0].botRvnQortAmount)
|
||||
@ -1764,7 +1764,7 @@ class AppView extends connect(store)(LitElement) {
|
||||
}
|
||||
|
||||
if (this.isEmptyArray(this.tradeBotRvnBook) === true) {
|
||||
return
|
||||
|
||||
} else {
|
||||
const checkBotRvnFunds = this.round(parseFloat(this.tradeBotRvnBook[0].botRvnQortAmount) * parseFloat(this.tradeBotRvnBook[0].botRvnPrice))
|
||||
const myBotRvnFunds = this.round(parseFloat(this.rvnWalletBalance))
|
||||
@ -1906,7 +1906,7 @@ class AppView extends connect(store)(LitElement) {
|
||||
await appDelay(1000)
|
||||
|
||||
if (this.isEmptyArray(this.tradeBotAvailableArrrQortal) === true) {
|
||||
return
|
||||
|
||||
} else {
|
||||
const botarrrprice = this.round(parseFloat(this.tradeBotArrrBook[0].botArrrPrice))
|
||||
const changearrramount = parseFloat(this.tradeBotArrrBook[0].botArrrQortAmount)
|
||||
@ -1950,7 +1950,7 @@ class AppView extends connect(store)(LitElement) {
|
||||
}
|
||||
|
||||
if (this.isEmptyArray(this.tradeBotArrrBook) === true) {
|
||||
return
|
||||
|
||||
} else {
|
||||
const checkBotArrrFunds = this.round(parseFloat(this.tradeBotArrrBook[0].botArrrQortAmount) * parseFloat(this.tradeBotArrrBook[0].botArrrPrice))
|
||||
const myBotArrrFunds = this.round(parseFloat(this.arrrWalletBalance))
|
||||
@ -2243,7 +2243,7 @@ class AppView extends connect(store)(LitElement) {
|
||||
this.helperMessage = this.renderHelperErr()
|
||||
await errDelay(3000)
|
||||
this.helperMessage = this.renderHelperPass()
|
||||
return
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -3365,4 +3365,4 @@ class AppView extends connect(store)(LitElement) {
|
||||
}
|
||||
}
|
||||
|
||||
window.customElements.define('app-view', AppView)
|
||||
window.customElements.define('app-view', AppView)
|
||||
|
@ -5,7 +5,7 @@ import '@material/mwc-icon';
|
||||
import '@polymer/paper-spinner/paper-spinner-lite.js';
|
||||
import '@vaadin/tooltip';
|
||||
import '@material/mwc-button';
|
||||
import { get, translate } from '../../../translate/index.js';
|
||||
import { get, translate } from '../../../translate';
|
||||
import '@polymer/paper-dialog/paper-dialog.js';
|
||||
import { setNewTab } from '../../redux/app/app-actions.js';
|
||||
import { store } from '../../store.js';
|
||||
@ -116,7 +116,7 @@ class TourComponent extends connect(store)(LitElement) {
|
||||
|
||||
_controlOpenWelcomeModal() {
|
||||
this.isSynced = true
|
||||
|
||||
|
||||
const seenWelcomeSync = JSON.parse(
|
||||
localStorage.getItem('welcome-sync') || 'false'
|
||||
);
|
||||
@ -280,7 +280,7 @@ class TourComponent extends connect(store)(LitElement) {
|
||||
<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>
|
||||
</div>
|
||||
|
||||
|
||||
`,
|
||||
},
|
||||
});
|
||||
@ -397,7 +397,7 @@ class TourComponent extends connect(store)(LitElement) {
|
||||
class="close-button"
|
||||
@click=${()=> {
|
||||
this.onClose()
|
||||
|
||||
|
||||
}}
|
||||
>
|
||||
${translate("general.close")}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {css, html, LitElement} from 'lit'
|
||||
import {translate} from '../../translate/index.js'
|
||||
import {translate} from '../../translate'
|
||||
import isElectron from 'is-electron'
|
||||
|
||||
import '@polymer/paper-icon-button/paper-icon-button.js'
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {css, html, LitElement} from 'lit'
|
||||
import {get} from '../../../translate/index.js'
|
||||
import {get} from '../../../translate'
|
||||
import '@material/mwc-icon'
|
||||
import '@vaadin/tooltip';
|
||||
|
||||
@ -206,11 +206,9 @@ class ChatSideNavHeads extends LitElement {
|
||||
if(changedProperties.has('chatInfo')){
|
||||
return true
|
||||
}
|
||||
if(changedProperties.has('isImageLoaded')){
|
||||
return true
|
||||
}
|
||||
return !!changedProperties.has('isImageLoaded');
|
||||
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
getUrl(chatUrl) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {css, html, LitElement} from 'lit';
|
||||
import {translate,} from '../../../translate/index.js'
|
||||
import {translate,} from '../../../translate'
|
||||
import '@material/mwc-button';
|
||||
import '@material/mwc-dialog';
|
||||
import '@material/mwc-checkbox';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { LitElement, html, css } from 'lit';
|
||||
import { get, translate } from '../../../translate/index.js'
|
||||
import { get, translate } from '../../../translate'
|
||||
import axios from 'axios';
|
||||
import '@material/mwc-menu';
|
||||
import '@material/mwc-list/mwc-list-item.js';
|
||||
|
@ -8,7 +8,7 @@ import '@polymer/iron-icons/iron-icons.js';
|
||||
import { store } from '../../store.js';
|
||||
import { setNewTab } from '../../redux/app/app-actions.js';
|
||||
import '@material/mwc-icon';
|
||||
import { get, translate } from '../../../translate/index.js';
|
||||
import { get, translate } from '../../../translate';
|
||||
import { repeat } from 'lit/directives/repeat.js';
|
||||
import '../../../../plugins/plugins/core/components/TimeAgo.js';
|
||||
import '../notification-view/popover.js';
|
||||
@ -94,11 +94,7 @@ class BeginnerChecklist extends connect(store)(LitElement) {
|
||||
const res = await fetch(endpoint);
|
||||
const getNames = await res.json();
|
||||
|
||||
if (Array.isArray(getNames) && getNames.length > 0) {
|
||||
this.hasName = true;
|
||||
} else {
|
||||
this.hasName = false;
|
||||
}
|
||||
this.hasName = Array.isArray(getNames) && getNames.length > 0;
|
||||
} catch (error) {
|
||||
return '';
|
||||
}
|
||||
@ -132,7 +128,7 @@ class BeginnerChecklist extends connect(store)(LitElement) {
|
||||
state.app.accountInfo.names.length > 0
|
||||
) {
|
||||
this.hasName = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
handleBlur() {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import {css, html, LitElement} from 'lit'
|
||||
import {store} from '../../store'
|
||||
import {connect} from 'pwa-helpers'
|
||||
import {translate} from '../../../translate/index.js'
|
||||
import {translate} from '../../../translate'
|
||||
|
||||
class CoreSyncStatus extends connect(store)(LitElement) {
|
||||
static get properties() {
|
||||
@ -201,4 +201,4 @@ class CoreSyncStatus extends connect(store)(LitElement) {
|
||||
|
||||
}
|
||||
|
||||
customElements.define('core-sync-status', CoreSyncStatus)
|
||||
customElements.define('core-sync-status', CoreSyncStatus)
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {css, html, LitElement} from 'lit';
|
||||
import {translate,} from '../../../translate/index.js'
|
||||
import {translate,} from '../../../translate'
|
||||
import axios from 'axios'
|
||||
import '@material/mwc-menu';
|
||||
import '@material/mwc-list/mwc-list-item.js'
|
||||
|
@ -2,7 +2,7 @@
|
||||
import { css, html, LitElement } from 'lit';
|
||||
import { createPopper } from '@popperjs/core';
|
||||
import '@material/mwc-icon';
|
||||
import { translate } from '../../../translate/index.js'
|
||||
import { translate } from '../../../translate'
|
||||
import { store } from '../../store';
|
||||
import { connect } from 'pwa-helpers';
|
||||
import { setNewTab, setSideEffectAction } from '../../redux/app/app-actions';
|
||||
|
@ -5,7 +5,7 @@ import {friendsViewStyles} from './friends-view-css';
|
||||
import {connect} from 'pwa-helpers';
|
||||
import {store} from '../../store';
|
||||
import './feed-item'
|
||||
import {translate} from '../../../translate/index.js'
|
||||
import {translate} from '../../../translate'
|
||||
|
||||
import '@polymer/paper-spinner/paper-spinner-lite.js'
|
||||
|
||||
@ -216,7 +216,7 @@ this.getFeedOnInterval()
|
||||
|
||||
observerHandler(entries) {
|
||||
if (!entries[0].isIntersecting) {
|
||||
return;
|
||||
|
||||
} else {
|
||||
if (this.feedToRender.length < 20) {
|
||||
return;
|
||||
@ -375,7 +375,7 @@ this.getFeedOnInterval()
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
async loadAndMergeData() {
|
||||
let allData = this.feed
|
||||
|
@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit'
|
||||
import '@material/mwc-icon'
|
||||
import './friends-side-panel.js'
|
||||
import '@vaadin/tooltip'
|
||||
import {translate} from '../../../translate/index.js'
|
||||
import {translate} from '../../../translate'
|
||||
|
||||
class FriendsSidePanelParent extends LitElement {
|
||||
static get properties() {
|
||||
|
@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit';
|
||||
import '@material/mwc-icon';
|
||||
import './friends-view'
|
||||
import './friends-feed'
|
||||
import {translate} from '../../../translate/index.js'
|
||||
import {translate} from '../../../translate'
|
||||
|
||||
class FriendsSidePanel extends LitElement {
|
||||
static get properties() {
|
||||
|
@ -13,7 +13,7 @@ import './ChatSideNavHeads';
|
||||
import '../../../../plugins/plugins/core/components/ChatSearchResults'
|
||||
import './add-friends-modal'
|
||||
|
||||
import {translate,} from '../../../translate/index.js'
|
||||
import {translate,} from '../../../translate'
|
||||
import {store} from '../../store';
|
||||
import {friendsViewStyles} from './friends-view-css';
|
||||
import {parentEpml} from '../show-plugin';
|
||||
@ -125,7 +125,7 @@ class FriendsView extends connect(store)(LitElement) {
|
||||
name
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
this.isOpenAddFriendsModal = true
|
||||
this.openSidePanel()
|
||||
}
|
||||
@ -165,7 +165,7 @@ class FriendsView extends connect(store)(LitElement) {
|
||||
|
||||
observerHandler(entries) {
|
||||
if (!entries[0].isIntersecting) {
|
||||
return;
|
||||
|
||||
} else {
|
||||
if (this.friendList.length < 20) {
|
||||
return;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { LitElement, html, css } from 'lit';
|
||||
import { render } from 'lit/html.js';
|
||||
import { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from '../../../translate/index.js'
|
||||
import { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from '../../../translate'
|
||||
import '@material/mwc-button';
|
||||
import '@material/mwc-icon';
|
||||
import '@vaadin/tooltip';
|
||||
@ -274,7 +274,7 @@ class ProfileModalUpdate extends connect(store)(LitElement) {
|
||||
this.requestUpdate();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
async firstUpdated() {
|
||||
@ -549,12 +549,12 @@ class ProfileModalUpdate extends connect(store)(LitElement) {
|
||||
<div
|
||||
style="display:flex;justify-content:center;flex-direction:column;gap:25px"
|
||||
>
|
||||
|
||||
|
||||
<div
|
||||
style="display:flex;gap:15px;align-items:center"
|
||||
>
|
||||
<p
|
||||
|
||||
|
||||
style="color: var(--black);font-size:16px"
|
||||
>
|
||||
${key}
|
||||
@ -592,9 +592,9 @@ class ProfileModalUpdate extends connect(store)(LitElement) {
|
||||
>
|
||||
${translate('general.close')}
|
||||
</button>
|
||||
|
||||
|
||||
<div style="display:flex;gap:10px;align-items:center">
|
||||
|
||||
|
||||
<button
|
||||
?disabled="${this.isLoading}"
|
||||
class="modal-button"
|
||||
@ -718,7 +718,7 @@ class ProfileModalUpdate extends connect(store)(LitElement) {
|
||||
class="input"
|
||||
.value=${this.newFieldName}
|
||||
@change=${(e) => {
|
||||
this.newFieldName = e.target.value
|
||||
this.newFieldName = e.target.value
|
||||
}}
|
||||
/>
|
||||
<input
|
||||
|
@ -6,7 +6,7 @@ import { store } from '../../store.js';
|
||||
import WebWorker2 from '../WebWorkerFile.js';
|
||||
import '@polymer/paper-spinner/paper-spinner-lite.js';
|
||||
import '@vaadin/tooltip';
|
||||
import { get, translate } from '../../../translate/index.js'
|
||||
import { get, translate } from '../../../translate'
|
||||
import ShortUniqueId from 'short-unique-id';
|
||||
import '@polymer/paper-dialog/paper-dialog.js';
|
||||
|
||||
@ -814,11 +814,7 @@ class ProfileQdn extends connect(store)(LitElement) {
|
||||
const findIndex = friendList.findIndex(
|
||||
(friend) => friend.name === name
|
||||
);
|
||||
if (findIndex !== -1) {
|
||||
this.isFriend = true;
|
||||
} else {
|
||||
this.isFriend = false;
|
||||
}
|
||||
this.isFriend = findIndex !== -1;
|
||||
} catch (error) {}
|
||||
}
|
||||
render() {
|
||||
|
@ -6,12 +6,12 @@ import { store } from '../../store.js';
|
||||
import WebWorker from '../WebWorkerFile.js';
|
||||
import '@polymer/paper-spinner/paper-spinner-lite.js';
|
||||
import '@vaadin/tooltip';
|
||||
import { get, translate } from '../../../translate/index.js'
|
||||
import { get, translate } from '../../../translate'
|
||||
import ShortUniqueId from 'short-unique-id';
|
||||
|
||||
import {
|
||||
decryptGroupData,
|
||||
|
||||
|
||||
encryptDataGroup,
|
||||
objectToBase64,
|
||||
uint8ArrayToObject,
|
||||
@ -331,7 +331,7 @@ class SaveSettingsQdn extends connect(store)(LitElement) {
|
||||
nameObject = store.getState().app.accountInfo.names[0];
|
||||
|
||||
} catch (error) {
|
||||
|
||||
|
||||
}
|
||||
if (!nameObject) {
|
||||
this.name = null;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {css, html, LitElement} from 'lit'
|
||||
import {registerTranslateConfig, translate, use} from '../../translate/index.js'
|
||||
import {registerTranslateConfig, translate, use} from '../../translate'
|
||||
|
||||
registerTranslateConfig({
|
||||
loader: lang => fetch(`/language/${lang}.json`).then(res => res.json())
|
||||
|
@ -1,7 +1,7 @@
|
||||
import {css, html, LitElement} from 'lit'
|
||||
import {connect} from 'pwa-helpers'
|
||||
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 {doLogin, doLogout, doSelectAddress} from '../../redux/app/app-actions.js'
|
||||
|
@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit'
|
||||
import {connect} from 'pwa-helpers'
|
||||
import {store} from '../../store.js'
|
||||
import {checkApiKey} from '../../apiKeyUtils.js'
|
||||
import {translate} from '../../../translate/index.js'
|
||||
import {translate} from '../../../translate'
|
||||
|
||||
import '@material/mwc-button'
|
||||
import '@material/mwc-checkbox'
|
||||
|
@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit'
|
||||
import {connect} from 'pwa-helpers'
|
||||
import {store} from '../../store.js'
|
||||
import {stateAwait} from '../../stateAwait.js'
|
||||
import {get} from '../../../translate/index.js'
|
||||
import {get} from '../../../translate'
|
||||
|
||||
import '@material/mwc-button'
|
||||
import '@material/mwc-icon'
|
||||
|
@ -1255,11 +1255,11 @@ function hexToRgb(hex) {
|
||||
g: parseInt(result[2], 16),
|
||||
b: parseInt(result[3], 16)
|
||||
} : null
|
||||
};
|
||||
}
|
||||
|
||||
function clamp(number, min, max) {
|
||||
return Math.min(Math.max(number, min), max)
|
||||
};
|
||||
}
|
||||
|
||||
function isInArray(value, array) {
|
||||
return array.indexOf(value) > -1
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {css, html, LitElement} from 'lit'
|
||||
import {translate} from '../../../translate/index.js'
|
||||
import {translate} from '../../../translate'
|
||||
|
||||
import '@material/mwc-button'
|
||||
|
||||
|
@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit'
|
||||
import {connect} from 'pwa-helpers'
|
||||
import {store} from '../../store.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 '@material/mwc-button'
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {css, html, LitElement} from 'lit'
|
||||
import {registerTranslateConfig, translate, use} from '../../translate/index.js'
|
||||
import {registerTranslateConfig, translate, use} from '../../translate'
|
||||
|
||||
registerTranslateConfig({
|
||||
loader: lang => fetch(`/language/${lang}.json`).then(res => res.json())
|
||||
|
@ -8,7 +8,7 @@ import '@polymer/iron-icons/iron-icons.js';
|
||||
import {store} from '../../store.js';
|
||||
import {setNewNotification} from '../../redux/app/app-actions.js';
|
||||
import '@material/mwc-icon';
|
||||
import {get, translate} from '../../../translate/index.js'
|
||||
import {get, translate} from '../../../translate'
|
||||
import {repeat} from 'lit/directives/repeat.js';
|
||||
import '../../../../plugins/plugins/core/components/TimeAgo.js';
|
||||
import './popover.js';
|
||||
@ -20,7 +20,6 @@ class NotificationBellGeneral extends connect(store)(LitElement) {
|
||||
showNotifications: { type: Boolean },
|
||||
notificationCount: { type: Boolean },
|
||||
theme: { type: String, reflect: true },
|
||||
notifications: { type: Array },
|
||||
currentNotification: { type: Object },
|
||||
};
|
||||
|
||||
|
@ -111,11 +111,7 @@ class NotificationBell extends connect(store)(LitElement) {
|
||||
}
|
||||
this.notifications = notificationsToShow
|
||||
|
||||
if (this.notifications.length === 0) {
|
||||
this.notificationCount = false
|
||||
} else {
|
||||
this.notificationCount = true
|
||||
}
|
||||
this.notificationCount = this.notifications.length !== 0;
|
||||
|
||||
if (!this.initialFetch) this.initialFetch = true
|
||||
} catch (error) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
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 '@polymer/paper-icon-button/paper-icon-button.js'
|
||||
@ -118,7 +118,7 @@ class SearchModal extends LitElement {
|
||||
dismiss: true
|
||||
})
|
||||
this.shadowRoot.getElementById('searchContent').value = this.searchContentString
|
||||
return
|
||||
|
||||
} else {
|
||||
let sendInfoAddress = this.shadowRoot.getElementById('searchContent').value
|
||||
const infoDialog = document.getElementById('main-app').shadowRoot.querySelector('app-view').shadowRoot.querySelector('user-info-view')
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { LitElement, html, css } from 'lit'
|
||||
import { connect } from 'pwa-helpers'
|
||||
import { store } from '../../store.js'
|
||||
import { get, translate } from '../../../translate/index.js'
|
||||
import { get, translate } from '../../../translate'
|
||||
|
||||
class AccountView extends connect(store)(LitElement) {
|
||||
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)
|
||||
|
@ -3,7 +3,7 @@ import {connect} from 'pwa-helpers'
|
||||
import {store} from '../../store.js'
|
||||
import { Epml } from '../../epml.js'
|
||||
import { addTradeBotRoutes } from '../../tradebot/addTradeBotRoutes.js'
|
||||
import {get, translate} from '../../../translate/index.js'
|
||||
import {get, translate} from '../../../translate'
|
||||
import snackbar from '../../functional-components/snackbar.js'
|
||||
import FileSaver from 'file-saver'
|
||||
|
||||
|
@ -3,7 +3,7 @@ import {connect} from 'pwa-helpers'
|
||||
import {store} from '../../store.js'
|
||||
import {allowShowSyncIndicator, removeShowSyncIndicator} from '../../redux/app/app-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 '@material/mwc-checkbox'
|
||||
|
@ -1,7 +1,7 @@
|
||||
import {css, html, LitElement} from 'lit'
|
||||
import {connect} from 'pwa-helpers'
|
||||
import {store} from '../../store.js'
|
||||
import {translate} from '../../../translate/index.js'
|
||||
import {translate} from '../../../translate'
|
||||
|
||||
import '@material/mwc-textfield'
|
||||
import '@material/mwc-icon'
|
||||
|
@ -10,7 +10,7 @@ import {
|
||||
removeQAPPAutoLists,
|
||||
setIsOpenDevDialog
|
||||
} 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 FileSaver from 'file-saver'
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import {css, html, LitElement} from 'lit'
|
||||
import {connect} from 'pwa-helpers'
|
||||
import {store} from '../../store.js'
|
||||
import {translate} from '../../../translate/index.js'
|
||||
import {translate} from '../../../translate'
|
||||
|
||||
import '@polymer/paper-dialog/paper-dialog.js'
|
||||
import '@material/mwc-button'
|
||||
|
@ -8,7 +8,7 @@ import {repeat} from 'lit/directives/repeat.js';
|
||||
import ShortUniqueId from 'short-unique-id';
|
||||
import {setIsOpenDevDialog, setNewTab} from '../redux/app/app-actions.js'
|
||||
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-dialog'
|
||||
import '@material/mwc-icon'
|
||||
@ -1995,11 +1995,7 @@ class NavBar extends connect(store)(LitElement) {
|
||||
this.myPluginNameRes = res
|
||||
})
|
||||
|
||||
if (this.myPluginNameRes === undefined || this.myPluginNameRes.length == 0) {
|
||||
myPluginName = false
|
||||
} else {
|
||||
myPluginName = true
|
||||
}
|
||||
myPluginName = !(this.myPluginNameRes === undefined || this.myPluginNameRes.length == 0);
|
||||
return myPluginName
|
||||
}
|
||||
|
||||
@ -2060,11 +2056,7 @@ class NavBar extends connect(store)(LitElement) {
|
||||
this.myPluginNameRes = res
|
||||
})
|
||||
|
||||
if (this.myPluginNameRes === undefined || this.myPluginNameRes.length == 0 ) {
|
||||
myPluginName = false
|
||||
} else {
|
||||
myPluginName = true
|
||||
}
|
||||
myPluginName = !(this.myPluginNameRes === undefined || this.myPluginNameRes.length == 0);
|
||||
return myPluginName
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import {css, html, LitElement} from 'lit';
|
||||
import {connect} from 'pwa-helpers';
|
||||
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 '../functional-components/my-button.js';
|
||||
@ -293,7 +293,7 @@ const nonce = selectedAddress && selectedAddress.nonce;
|
||||
this.getMintingAcccounts();
|
||||
} catch (error) {
|
||||
this.errorMsg = this.renderErrorMsg3();
|
||||
return;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -426,7 +426,7 @@ const nonce = selectedAddress && selectedAddress.nonce;
|
||||
} catch (error) {
|
||||
console.log({ error })
|
||||
this.errorMsg = (error && error.data && error.data.message) ? error.data.message : this.renderErrorMsg4();
|
||||
return;
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
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/iron-icons/image-icons.js'
|
||||
import '@polymer/iron-icons/iron-icons.js'
|
||||
|
@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit'
|
||||
import {render} from 'lit/html.js'
|
||||
import {connect} from 'pwa-helpers'
|
||||
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 '@material/mwc-button'
|
||||
|
@ -3,7 +3,7 @@ import {css, html, LitElement} from 'lit'
|
||||
import '@material/mwc-button'
|
||||
import '@material/mwc-icon'
|
||||
|
||||
import {translate} from '../../translate/index.js'
|
||||
import {translate} from '../../translate'
|
||||
|
||||
class FragFileInput extends LitElement {
|
||||
static get properties () {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import {css, html, LitElement} from 'lit'
|
||||
import {connect} from 'pwa-helpers'
|
||||
import {store} from '../store.js'
|
||||
import {get, translate} from '../../translate/index.js'
|
||||
import {get, translate} from '../../translate'
|
||||
|
||||
import {listenForRequest} from '../transactionRequest.js'
|
||||
|
||||
|
@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit'
|
||||
import {connect} from 'pwa-helpers'
|
||||
import {store} from '../store.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-button'
|
||||
|
@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit'
|
||||
import {connect} from 'pwa-helpers'
|
||||
import {store} from '../store.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 '../components/language-selector.js'
|
||||
import '../custom-elements/frag-file-input.js'
|
||||
|
@ -1,7 +1,7 @@
|
||||
import Base58 from './deps/Base58.js'
|
||||
import {kdf} from './kdf.js'
|
||||
import {AES_CBC, HmacSha512} from 'asmcrypto.js'
|
||||
import {get, registerTranslateConfig} from '../../core/translate/index.js'
|
||||
import {get, registerTranslateConfig} from '../../core/translate'
|
||||
|
||||
registerTranslateConfig({
|
||||
loader: lang => fetch(`/language/${lang}.json`).then(res => res.json())
|
||||
|
@ -2,7 +2,7 @@ import {store} from '../api_deps.js'
|
||||
import {stateAwait} from './utils/stateAwait.js'
|
||||
import {Sha512} from 'asmcrypto.js'
|
||||
import utils from '../api/deps/utils.js'
|
||||
import {get, registerTranslateConfig} from '../../core/translate/index.js'
|
||||
import {get, registerTranslateConfig} from '../../core/translate'
|
||||
|
||||
registerTranslateConfig({
|
||||
loader: lang => fetch(`/language/${lang}.json`).then(res => res.json())
|
||||
|
@ -3,8 +3,6 @@ import Base58 from '../deps/Base58.js'
|
||||
export const validateAddress = (address) => {
|
||||
const decodePubKey = Base58.decode(address)
|
||||
|
||||
if (!(decodePubKey instanceof Uint8Array && decodePubKey.length == 25)) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
return decodePubKey instanceof Uint8Array && decodePubKey.length == 25;
|
||||
|
||||
}
|
||||
|
40
electron.js
40
electron.js
@ -168,11 +168,7 @@ function doesFileExist(urlToJavaFile) {
|
||||
xhr.open('HEAD', urlToJavaFile, true)
|
||||
xhr.send()
|
||||
|
||||
if (xhr.status == "404") {
|
||||
return false
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
return xhr.status != "404";
|
||||
}
|
||||
|
||||
async function checkWin() {
|
||||
@ -197,7 +193,7 @@ async function checkWin() {
|
||||
store.set('askingCore', returnValue.checkboxChecked)
|
||||
} else {
|
||||
store.set('askingCore', returnValue.checkboxChecked)
|
||||
return
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -215,7 +211,7 @@ async function checkWin() {
|
||||
if (returnValue.response === 0) {
|
||||
downloadWindows()
|
||||
} else {
|
||||
return
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -227,7 +223,7 @@ async function checkOsPlatform() {
|
||||
} else if (process.platform === 'linux' || process.platform === 'darwin') {
|
||||
startElectronUnix()
|
||||
} else {
|
||||
return
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -252,7 +248,7 @@ async function startElectronWin() {
|
||||
if (returnValue.response === 0) {
|
||||
downloadWindows()
|
||||
} else {
|
||||
return
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -279,7 +275,7 @@ function startElectronUnix() {
|
||||
if (returnValue.response === 0) {
|
||||
downloadQortal()
|
||||
} else {
|
||||
return
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -340,7 +336,7 @@ async function checkPort() {
|
||||
|
||||
async function checkResponseStatus(res) {
|
||||
if (res.ok) {
|
||||
return
|
||||
|
||||
} else if (process.platform === 'win32') {
|
||||
await checkWin()
|
||||
} else {
|
||||
@ -382,7 +378,7 @@ async function javaversion() {
|
||||
})
|
||||
|
||||
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;
|
||||
log.info("Java Version", javaVersion)
|
||||
if (javaVersion != false) {
|
||||
@ -399,7 +395,7 @@ async function javaversion() {
|
||||
if (returnValue.response === 0) {
|
||||
installJava()
|
||||
} else {
|
||||
return
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -706,7 +702,7 @@ function checkQortal() {
|
||||
store.set('askingCore', returnValue.checkboxChecked)
|
||||
} else {
|
||||
store.set('askingCore', returnValue.checkboxChecked)
|
||||
return
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -724,7 +720,7 @@ function checkQortal() {
|
||||
if (returnValue.response === 0) {
|
||||
downloadQortal()
|
||||
} else {
|
||||
return
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -807,7 +803,7 @@ async function checkAndStart() {
|
||||
store.set('askingCore', returnValue.checkboxChecked)
|
||||
} else {
|
||||
store.set('askingCore', returnValue.checkboxChecked)
|
||||
return
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -986,7 +982,7 @@ const editMenu = Menu.buildFromTemplate([
|
||||
store.set('askingCore', returnValue.checkboxChecked)
|
||||
} else {
|
||||
store.set('askingCore', returnValue.checkboxChecked)
|
||||
return
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -1143,7 +1139,7 @@ const createTray = () => {
|
||||
store.set('askingCore', returnValue.checkboxChecked)
|
||||
} else {
|
||||
store.set('askingCore', returnValue.checkboxChecked)
|
||||
return
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
@ -1243,7 +1239,7 @@ if (!isLock) {
|
||||
store.set('askingCore', returnValue.checkboxChecked)
|
||||
} else {
|
||||
store.set('askingCore', returnValue.checkboxChecked)
|
||||
return
|
||||
|
||||
}
|
||||
})
|
||||
})
|
||||
@ -1329,7 +1325,7 @@ if (!isLock) {
|
||||
})
|
||||
dl.show()
|
||||
} else {
|
||||
return
|
||||
|
||||
}
|
||||
})
|
||||
})
|
||||
@ -1351,7 +1347,7 @@ if (!isLock) {
|
||||
if (returnValue.response === 0) {
|
||||
autoUpdater.quitAndInstall()
|
||||
} else {
|
||||
return
|
||||
|
||||
}
|
||||
})
|
||||
})
|
||||
@ -1372,4 +1368,4 @@ if (!isLock) {
|
||||
process.on('uncaughtException', function (err) {
|
||||
log.info("*** WHOOPS TIME ***" + err)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
import {html, LitElement} from 'lit'
|
||||
import {Epml} from '../../../epml.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 isElectron from 'is-electron'
|
||||
import '@polymer/paper-spinner/paper-spinner-lite.js'
|
||||
|
@ -1,7 +1,7 @@
|
||||
import {html, LitElement} from 'lit'
|
||||
import {Epml} from '../../../../epml.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 '@material/mwc-button'
|
||||
|
@ -1,6 +1,6 @@
|
||||
import {html, LitElement} from 'lit'
|
||||
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 '@material/mwc-button'
|
||||
|
@ -9,7 +9,7 @@ import {bytesToMegabytes} from '../../../utils/bytesToMegabytes.js';
|
||||
import './ChatGifsExplore.js';
|
||||
import '../ImageComponent.js';
|
||||
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});
|
||||
|
||||
@ -150,11 +150,7 @@ setOpenGifModal: { attribute: false }
|
||||
if (changedProperties && changedProperties.has('currentCollection')) {
|
||||
if (this.mode === 'explore') {
|
||||
const subbedCollection = this.mySubscribedCollections.find((collection) => ((collection.name === this.currentCollection.name) && (collection.identifier === this.currentCollection.identifier)));
|
||||
if (subbedCollection) {
|
||||
this.isSubscribed = true;
|
||||
} else {
|
||||
this.isSubscribed = false;
|
||||
}
|
||||
this.isSubscribed = !!subbedCollection;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -440,11 +436,7 @@ setOpenGifModal: { attribute: false }
|
||||
}
|
||||
}
|
||||
|
||||
if (invalidGifs.length > 0) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
return invalidGifs.length <= 0;
|
||||
}
|
||||
|
||||
let validatedSize = validateGifSizes(this.gifsToBeAdded);
|
||||
|
@ -1,7 +1,7 @@
|
||||
import {html, LitElement} from 'lit'
|
||||
import {Epml} from '../../../../epml.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'
|
||||
|
||||
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent });
|
||||
@ -52,7 +52,7 @@ class ChatGifsExplore extends LitElement {
|
||||
|
||||
observerHandler(entries) {
|
||||
if (!entries[0].isIntersecting) {
|
||||
return;
|
||||
|
||||
} else {
|
||||
if (this.exploreCollections.length < 20) {
|
||||
return;
|
||||
|
@ -5,7 +5,7 @@ import "@material/mwc-dialog"
|
||||
import "@polymer/paper-spinner/paper-spinner-lite.js"
|
||||
import "@material/mwc-icon"
|
||||
import "./WrapperModal"
|
||||
import {translate} from '../../../../core/translate/index.js'
|
||||
import {translate} from '../../../../core/translate'
|
||||
|
||||
const parentEpml = new Epml({ type: "WINDOW", source: window.parent })
|
||||
|
||||
|
@ -11,7 +11,7 @@ import './TipUser';
|
||||
import './UserInfo/UserInfo';
|
||||
import './ChatImage';
|
||||
import './ReusableImage';
|
||||
import {get} from '../../../../core/translate/index.js'
|
||||
import {get} from '../../../../core/translate'
|
||||
|
||||
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent });
|
||||
|
||||
@ -284,7 +284,7 @@ class ChatGroupsManager extends LitElement {
|
||||
|
||||
observerHandler(entries) {
|
||||
if (!entries[0].isIntersecting) {
|
||||
return;
|
||||
|
||||
} else {
|
||||
if (this.images.length < 20) {
|
||||
return;
|
||||
@ -294,19 +294,11 @@ class ChatGroupsManager extends LitElement {
|
||||
}
|
||||
|
||||
selectAuto(e) {
|
||||
if (e.target.checked) {
|
||||
this.autoView = false
|
||||
} else {
|
||||
this.autoView = true
|
||||
}
|
||||
this.autoView = !e.target.checked;
|
||||
}
|
||||
|
||||
selectMyImages(e) {
|
||||
if (e.target.checked) {
|
||||
this.onlyMyImages = false
|
||||
} else {
|
||||
this.onlyMyImages = true
|
||||
}
|
||||
this.onlyMyImages = !e.target.checked;
|
||||
}
|
||||
|
||||
render() {
|
||||
|
@ -5,7 +5,7 @@ import '@material/mwc-dialog'
|
||||
import '@polymer/paper-spinner/paper-spinner-lite.js'
|
||||
import '@material/mwc-icon'
|
||||
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 })
|
||||
|
||||
|
@ -10,7 +10,7 @@ import '@vaadin/tabs/theme/material/vaadin-tabs.js'
|
||||
import '@vaadin/avatar'
|
||||
import '@vaadin/grid'
|
||||
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 })
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
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-list/mwc-list-item.js';
|
||||
import '@material/mwc-dialog'
|
||||
|
@ -1,5 +1,5 @@
|
||||
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 {RequestQueueWithPromise} from '../../utils/queue';
|
||||
import '@material/mwc-menu';
|
||||
@ -231,11 +231,9 @@ getMyNode(){
|
||||
}
|
||||
|
||||
shouldUpdate(changedProperties) {
|
||||
if (changedProperties.has('setOpenDialogImage') && changedProperties.size === 1) {
|
||||
return false;
|
||||
}
|
||||
return !(changedProperties.has('setOpenDialogImage') && changedProperties.size === 1);
|
||||
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
|
@ -5,7 +5,7 @@ import '@material/mwc-dialog'
|
||||
import '@polymer/paper-spinner/paper-spinner-lite.js'
|
||||
import '@material/mwc-icon'
|
||||
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 })
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import {css, html, LitElement} from 'lit'
|
||||
import {Epml} from '../../../epml'
|
||||
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-dialog'
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import {html, LitElement} from 'lit'
|
||||
import {animate} from '@lit-labs/motion'
|
||||
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 {unsafeHTML} from 'lit/directives/unsafe-html.js'
|
||||
import {escape} from 'html-escaper'
|
||||
@ -263,11 +263,11 @@ class ChatPage extends LitElement {
|
||||
}
|
||||
|
||||
_toggle(value) {
|
||||
this.shifted = value === (false || true) ? value : !this.shifted
|
||||
this.shifted = value === true ? value : !this.shifted
|
||||
this.requestUpdate()
|
||||
}
|
||||
_toggleResources(value) {
|
||||
this.shiftedResources = value === (false || true) ? value : !this.shiftedResources
|
||||
this.shiftedResources = value === true ? value : !this.shiftedResources
|
||||
this.requestUpdate()
|
||||
}
|
||||
|
||||
@ -1114,7 +1114,7 @@ class ChatPage extends LitElement {
|
||||
if (blobFound) {
|
||||
this.insertFile(blobFound)
|
||||
e.preventDefault();
|
||||
return
|
||||
|
||||
} else {
|
||||
const item_list = await navigator.clipboard.read()
|
||||
let image_type
|
||||
@ -1140,7 +1140,7 @@ class ChatPage extends LitElement {
|
||||
parentEpml.request('showSnackBar', `${errorMsg}`)
|
||||
}
|
||||
} else {
|
||||
return
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1279,16 +1279,16 @@ class ChatPage extends LitElement {
|
||||
if(file.identifier){
|
||||
this.imageFile = file
|
||||
this.currentEditor = 'newChat'
|
||||
return
|
||||
|
||||
}else
|
||||
if (file.type.includes('image')) {
|
||||
this.imageFile = file
|
||||
this.currentEditor = 'newChat'
|
||||
return
|
||||
|
||||
} else {
|
||||
this.attachment = file
|
||||
this.currentEditor = "newAttachmentChat"
|
||||
return
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -1494,11 +1494,9 @@ class ChatPage extends LitElement {
|
||||
if (changedProperties.has('setActiveChatHeadUrl')) {
|
||||
return false
|
||||
}
|
||||
if (changedProperties.has('setOpenPrivateMessage')) {
|
||||
return false
|
||||
}
|
||||
return !changedProperties.has('setOpenPrivateMessage');
|
||||
|
||||
|
||||
return true
|
||||
|
||||
}
|
||||
|
||||
@ -3125,7 +3123,7 @@ class ChatPage extends LitElement {
|
||||
} catch (error) {
|
||||
this.isLoading = false
|
||||
this.isUploadingImage = false
|
||||
return
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -217,7 +217,7 @@ class ChatRightPanel extends LitElement {
|
||||
|
||||
observerHandler(entries) {
|
||||
if (!entries[0].isIntersecting) {
|
||||
return
|
||||
|
||||
} else {
|
||||
if(this.groupMembers.length < 20){
|
||||
return
|
||||
|
@ -11,7 +11,7 @@ import './TipUser';
|
||||
import './UserInfo/UserInfo';
|
||||
import './ChatImage';
|
||||
import './ReusableImage';
|
||||
import {get, translate,} from '../../../../core/translate/index.js'
|
||||
import {get, translate,} from '../../../../core/translate'
|
||||
import {generateIdFromAddresses} from '../../utils/id-generation';
|
||||
|
||||
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent });
|
||||
@ -307,7 +307,7 @@ class ChatRightPanelResources extends LitElement {
|
||||
|
||||
observerHandler(entries) {
|
||||
if (!entries[0].isIntersecting) {
|
||||
return;
|
||||
|
||||
} else {
|
||||
if (this.images.length < 20) {
|
||||
return;
|
||||
@ -317,19 +317,11 @@ class ChatRightPanelResources extends LitElement {
|
||||
}
|
||||
|
||||
selectAuto(e) {
|
||||
if (e.target.checked) {
|
||||
this.autoView = false
|
||||
} else {
|
||||
this.autoView = true
|
||||
}
|
||||
this.autoView = !e.target.checked;
|
||||
}
|
||||
|
||||
selectMyImages(e) {
|
||||
if (e.target.checked) {
|
||||
this.onlyMyImages = false
|
||||
} else {
|
||||
this.onlyMyImages = true
|
||||
}
|
||||
this.onlyMyImages = !e.target.checked;
|
||||
}
|
||||
|
||||
render() {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import {html, LitElement,} from 'lit';
|
||||
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 {chatStyles} from './ChatScroller-css.js';
|
||||
import {Epml} from '../../../epml';
|
||||
@ -676,13 +676,9 @@ class ChatScroller extends LitElement {
|
||||
|
||||
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 (
|
||||
message.timestamp < this.lastReadMessageTimestamp &&
|
||||
formattedMessages.indexOf(message) === formattedMessages.length - 21
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return message.timestamp < this.lastReadMessageTimestamp &&
|
||||
formattedMessages.indexOf(message) === formattedMessages.length - 21;
|
||||
|
||||
}
|
||||
|
||||
render() {
|
||||
@ -1097,11 +1093,7 @@ class MessageTemplate extends LitElement {
|
||||
}
|
||||
|
||||
showBlockIconFunc(bool) {
|
||||
if (bool) {
|
||||
this.showBlockAddressIcon = true;
|
||||
} else {
|
||||
this.showBlockAddressIcon = false;
|
||||
}
|
||||
this.showBlockAddressIcon = !!bool;
|
||||
}
|
||||
|
||||
async downloadAttachment(attachment) {
|
||||
@ -1206,10 +1198,8 @@ class MessageTemplate extends LitElement {
|
||||
if (changedProperties.has('openDialogGif')) {
|
||||
return true;
|
||||
}
|
||||
if (changedProperties.has('isGifLoaded')) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return !!changedProperties.has('isGifLoaded');
|
||||
|
||||
}
|
||||
|
||||
clearConsole() {
|
||||
@ -2535,4 +2525,4 @@ class ChatMenu extends LitElement {
|
||||
}
|
||||
}
|
||||
|
||||
window.customElements.define('chat-menu', ChatMenu);
|
||||
window.customElements.define('chat-menu', ChatMenu);
|
||||
|
@ -1,6 +1,6 @@
|
||||
import {html, LitElement} from 'lit';
|
||||
import {chatSearchResultsStyles} from './ChatSearchResults-css.js'
|
||||
import {translate} from '../../../../core/translate/index.js'
|
||||
import {translate} from '../../../../core/translate'
|
||||
|
||||
export class ChatSearchResults extends LitElement {
|
||||
static get properties() {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import {html, LitElement} from 'lit'
|
||||
import {chatSearchResultsStyles} from './ChatSearchResults-css.js'
|
||||
import {translate} from '../../../../core/translate/index.js'
|
||||
import {translate} from '../../../../core/translate'
|
||||
import '@vaadin/icon'
|
||||
import '@vaadin/icons'
|
||||
|
||||
|
@ -210,11 +210,9 @@ class ChatSelect extends LitElement {
|
||||
if(changedProperties.has('activeChatHeadUrl')){
|
||||
return true
|
||||
}
|
||||
if(changedProperties.has('chatInfo')){
|
||||
return true
|
||||
}
|
||||
return !!changedProperties.has('chatInfo');
|
||||
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
getUrl(chatUrl) {
|
||||
|
@ -185,11 +185,9 @@ class ChatSideNavHeads extends LitElement {
|
||||
if(changedProperties.has('chatInfo')){
|
||||
return true
|
||||
}
|
||||
if(changedProperties.has('isImageLoaded')){
|
||||
return true
|
||||
}
|
||||
return !!changedProperties.has('isImageLoaded');
|
||||
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
getUrl(chatUrl) {
|
||||
|
@ -3,7 +3,7 @@ import {escape, unescape} from 'html-escaper'
|
||||
import {EmojiPicker} from 'emoji-picker-js'
|
||||
import {inputKeyCodes} from '../../utils/keyCodes.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 })
|
||||
|
||||
@ -268,7 +268,7 @@ class ChatTextEditor extends LitElement {
|
||||
if (!this.userName) {
|
||||
e.preventDefault();
|
||||
parentEpml.request('showSnackBar', get("chatpage.cchange27"));
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
initialChat(e) {
|
||||
@ -360,15 +360,15 @@ class ChatTextEditor extends LitElement {
|
||||
|
||||
shouldUpdate(changedProperties) {
|
||||
// Only update element if prop1 changed.
|
||||
if(changedProperties.has('setChatEditor') && changedProperties.size === 1) return false
|
||||
return true
|
||||
return !(changedProperties.has('setChatEditor') && changedProperties.size === 1);
|
||||
|
||||
}
|
||||
|
||||
sendMessageFunc(props) {
|
||||
if (this.chatMessageSize > 1000 ) {
|
||||
parentEpml.request('showSnackBar', get("chatpage.cchange29"))
|
||||
return
|
||||
};
|
||||
}
|
||||
this.chatMessageSize = 0
|
||||
this.chatEditor.updateMirror()
|
||||
this._sendMessage(props)
|
||||
|
@ -3,7 +3,7 @@ import {EmojiPicker} from 'emoji-picker-js'
|
||||
import {Epml} from '../../../epml.js'
|
||||
import '@material/mwc-icon'
|
||||
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 })
|
||||
|
||||
@ -358,10 +358,9 @@ class ChatTextEditor extends LitElement {
|
||||
.hide-styling {
|
||||
display: none;
|
||||
}
|
||||
mwc-checkbox::shadow .mdc-checkbox::after, mwc-checkbox::shadow .mdc-checkbox::before {
|
||||
background-color:var(--mdc-theme-primary)
|
||||
mwc-checkbox::shadow, mdc-checkbox::after, mwc-checkbox::shadow, mdc-checkbox::before {
|
||||
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) {
|
||||
// Only update element if prop1 changed.
|
||||
if(changedProperties.has('setChatEditor') && changedProperties.size === 1) return false
|
||||
return true
|
||||
return !(changedProperties.has('setChatEditor') && changedProperties.size === 1);
|
||||
|
||||
}
|
||||
|
||||
sendMessageFunc(props) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import {css, html, LitElement} from 'lit'
|
||||
import {Epml} from '../../../epml.js'
|
||||
import {get, registerTranslateConfig, translate, use} from '../../../../core/translate/index.js'
|
||||
import {get, registerTranslateConfig, translate, use} from '../../../../core/translate'
|
||||
import isElectron from 'is-electron'
|
||||
|
||||
import '@material/mwc-icon'
|
||||
@ -145,7 +145,7 @@ class ChatWelcomePage extends LitElement {
|
||||
}
|
||||
|
||||
h2, h3, h4, h5 {
|
||||
color:# var(--black);
|
||||
color: var(--black);
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
@ -369,7 +369,7 @@ class ChatWelcomePage extends LitElement {
|
||||
myRes = false;
|
||||
} else {
|
||||
myRes = myNameRes;
|
||||
};
|
||||
}
|
||||
return myRes;
|
||||
};
|
||||
|
||||
@ -379,7 +379,7 @@ class ChatWelcomePage extends LitElement {
|
||||
recipient = _recipient;
|
||||
} else {
|
||||
recipient = myNameRes.owner;
|
||||
};
|
||||
}
|
||||
|
||||
let _reference = new Uint8Array(64);
|
||||
window.crypto.getRandomValues(_reference);
|
||||
@ -411,7 +411,7 @@ class ChatWelcomePage extends LitElement {
|
||||
isEncrypted = 0;
|
||||
_publicKey = this.selectedAddress.address;
|
||||
sendMessageRequest(isEncrypted, _publicKey);
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
const sendMessageRequest = async (isEncrypted, _publicKey) => {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {css, html, LitElement} from 'lit';
|
||||
import {translate,} from '../../../../core/translate/index.js'
|
||||
import {translate,} from '../../../../core/translate'
|
||||
|
||||
export class ImageComponent extends LitElement {
|
||||
static get properties() {
|
||||
@ -78,11 +78,7 @@ export class ImageComponent extends LitElement {
|
||||
url: data.src,
|
||||
};
|
||||
this.requestUpdate();
|
||||
} else if (!data.ok || data.error) {
|
||||
this.error = true;
|
||||
} else {
|
||||
this.error = false;
|
||||
}
|
||||
} else this.error = !data.ok || data.error;
|
||||
} catch (error) {
|
||||
this.error = true;
|
||||
console.error(error);
|
||||
|
@ -1,6 +1,6 @@
|
||||
import {css, html, LitElement} from 'lit'
|
||||
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 {RequestQueue} from '../../utils/queue.js'
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import {css, html, LitElement} from 'lit'
|
||||
import {Epml} from '../../../epml.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-button'
|
||||
import '@material/mwc-dialog'
|
||||
@ -90,7 +90,7 @@ class NameMenu extends LitElement {
|
||||
}
|
||||
|
||||
h2, h3, h4, h5 {
|
||||
color:# var(--black);
|
||||
color: var(--black);
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
|
@ -207,7 +207,7 @@ var encode = function(ver, mode, data, maxbuflen) {
|
||||
pack(data[i], 8);
|
||||
}
|
||||
break;
|
||||
};
|
||||
}
|
||||
|
||||
pack(MODE_TERMINATOR, 4);
|
||||
if (remaining < 8) buf.push(bits);
|
||||
@ -596,4 +596,4 @@ var QRCode = {
|
||||
};
|
||||
|
||||
export { QRCode };
|
||||
export default QRCode;
|
||||
export default QRCode;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {css, html, LitElement} from 'lit'
|
||||
import {translate,} from '../../../../core/translate/index.js'
|
||||
import {translate,} from '../../../../core/translate'
|
||||
import axios from 'axios'
|
||||
import {RequestQueueWithPromise} from '../../utils/queue'
|
||||
import '@material/mwc-menu'
|
||||
|
@ -3,7 +3,7 @@ import {tipUserStyles} from './TipUser-css.js'
|
||||
import {Epml} from '../../../epml'
|
||||
import '@vaadin/button'
|
||||
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 });
|
||||
|
||||
@ -140,7 +140,7 @@ export class TipUser extends LitElement {
|
||||
};
|
||||
|
||||
const validateAddress = async (receiverAddress) => {
|
||||
return await window.parent.validateAddress(receiverAddress);
|
||||
return window.parent.validateAddress(receiverAddress);
|
||||
};
|
||||
|
||||
const getName = async (recipient) => {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import {css, html, LitElement} from 'lit'
|
||||
import {render} from 'lit/html.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 './TraderInfoView.js'
|
||||
import '@polymer/paper-dialog/paper-dialog.js'
|
||||
|
@ -1,7 +1,7 @@
|
||||
import {css, html, LitElement} from 'lit'
|
||||
import {render} from 'lit/html.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 '@material/mwc-button'
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {html, LitElement} from 'lit'
|
||||
import {translate} from '../../../../../core/translate/index.js'
|
||||
import {translate} from '../../../../../core/translate'
|
||||
import {userInfoStyles} from './UserInfo-css.js'
|
||||
import {cropAddress} from '../../../utils/cropAddress.js'
|
||||
|
||||
@ -118,13 +118,13 @@ export class UserInfo extends LitElement {
|
||||
this.openProfile()
|
||||
}, 250);
|
||||
this.setOpenUserInfo(false)
|
||||
|
||||
|
||||
|
||||
|
||||
}}>
|
||||
${translate("profile.profile18")}
|
||||
</div>
|
||||
` : ''}
|
||||
|
||||
|
||||
</div>
|
||||
`
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ import {css, html, LitElement} from 'lit'
|
||||
import '@material/mwc-button'
|
||||
import '@material/mwc-icon'
|
||||
|
||||
import {translate} from '../../../../core/translate/index.js'
|
||||
import {translate} from '../../../../core/translate'
|
||||
|
||||
class FragFileInput extends LitElement {
|
||||
static get properties () {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import {css, html, LitElement} from 'lit'
|
||||
import {render} from 'lit/html.js'
|
||||
import {get, translate} from '../../../../core/translate/index.js'
|
||||
import {get, translate} from '../../../../core/translate'
|
||||
import '@polymer/paper-dialog/paper-dialog.js'
|
||||
import '@material/mwc-button'
|
||||
import '@material/mwc-icon'
|
||||
|
@ -75,7 +75,7 @@ export default class ExtendedTimeElement extends HTMLElement {
|
||||
}
|
||||
}
|
||||
getFormattedDate() {
|
||||
return;
|
||||
|
||||
}
|
||||
}
|
||||
const titleFormatter = makeFormatter({
|
||||
|
@ -240,7 +240,7 @@ class ExtendedTimeElement extends HTMLElement {
|
||||
}
|
||||
}
|
||||
getFormattedDate() {
|
||||
return;
|
||||
|
||||
}
|
||||
}
|
||||
const titleFormatter = makeFormatter({
|
||||
|
@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit'
|
||||
import {render} from 'lit/html.js'
|
||||
import {Epml} from '../../../epml.js'
|
||||
import isElectron from 'is-electron'
|
||||
import {get, registerTranslateConfig, translate, use} from '../../../../core/translate/index.js'
|
||||
import {get, registerTranslateConfig, translate, use} from '../../../../core/translate'
|
||||
import '../components/time-elements/index.js'
|
||||
import '@material/mwc-button'
|
||||
import '@material/mwc-dialog'
|
||||
@ -2491,7 +2491,7 @@ class GroupManagement extends LitElement {
|
||||
})
|
||||
|
||||
if (this.bannedMembers.length === 0) {
|
||||
return
|
||||
|
||||
} else {
|
||||
this.bannedMembers.map(a => {
|
||||
let callTheBannedMember = a.offender
|
||||
@ -2542,7 +2542,7 @@ class GroupManagement extends LitElement {
|
||||
})
|
||||
|
||||
if (this.groupInviteMembers.length === 0) {
|
||||
return
|
||||
|
||||
} else {
|
||||
this.groupInviteMembers.map(a => {
|
||||
let callTheInviteMember = a.invitee
|
||||
@ -2589,7 +2589,7 @@ class GroupManagement extends LitElement {
|
||||
})
|
||||
|
||||
if (this.groupJoinMembers.length === 0) {
|
||||
return
|
||||
|
||||
} else {
|
||||
this.groupJoinMembers.map(a => {
|
||||
let callTheJoinMember = a.joiner
|
||||
|
@ -938,7 +938,7 @@ class Chat extends LitElement {
|
||||
|
||||
getChatHeadFromState(chatObj) {
|
||||
if (chatObj === undefined) {
|
||||
return
|
||||
|
||||
} else {
|
||||
this.chatHeadsObj = chatObj
|
||||
this.setChatHeads(chatObj)
|
||||
@ -986,4 +986,4 @@ class Chat extends LitElement {
|
||||
}
|
||||
}
|
||||
|
||||
window.customElements.define('q-chat', Chat)
|
||||
window.customElements.define('q-chat', Chat)
|
||||
|
@ -1,7 +1,7 @@
|
||||
import {css, html, LitElement} from 'lit'
|
||||
import {Epml} from '../../../epml.js'
|
||||
import isElectron from 'is-electron'
|
||||
import {registerTranslateConfig, translate, use} from '../../../../core/translate/index.js'
|
||||
import {registerTranslateConfig, translate, use} from '../../../../core/translate'
|
||||
import '@material/mwc-icon'
|
||||
import '@material/mwc-button'
|
||||
import '@material/mwc-dialog'
|
||||
|
@ -1,7 +1,7 @@
|
||||
import {css, html, LitElement} from 'lit'
|
||||
import {render} from 'lit/html.js'
|
||||
import {Epml} from '../../../epml.js'
|
||||
import {get, registerTranslateConfig, translate, use} from '../../../../core/translate/index.js'
|
||||
import {get, registerTranslateConfig, translate, use} from '../../../../core/translate'
|
||||
import isElectron from 'is-electron'
|
||||
import '@material/mwc-button'
|
||||
import '@material/mwc-dialog'
|
||||
|
@ -1,7 +1,7 @@
|
||||
import {css, html, LitElement} from 'lit'
|
||||
import {render} from 'lit/html.js'
|
||||
import {Epml} from '../../../epml.js'
|
||||
import {get, registerTranslateConfig, translate, use} from '../../../../core/translate/index.js'
|
||||
import {get, registerTranslateConfig, translate, use} from '../../../../core/translate'
|
||||
import isElectron from 'is-electron'
|
||||
import '../components/qortal-info-view.js'
|
||||
import '@material/mwc-button'
|
||||
|
@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit'
|
||||
import {render} from 'lit/html.js'
|
||||
import {Epml} from '../../../epml.js'
|
||||
import isElectron from 'is-electron'
|
||||
import {get, registerTranslateConfig, translate, use} from '../../../../core/translate/index.js'
|
||||
import {get, registerTranslateConfig, translate, use} from '../../../../core/translate'
|
||||
import '@polymer/paper-spinner/paper-spinner-lite.js'
|
||||
import '@material/mwc-icon'
|
||||
import '@material/mwc-textfield'
|
||||
|
@ -1,6 +1,6 @@
|
||||
import {css, html, LitElement} from 'lit'
|
||||
import {Epml} from '../../../epml.js'
|
||||
import {get, registerTranslateConfig, translate, use} from '../../../../core/translate/index.js'
|
||||
import {get, registerTranslateConfig, translate, use} from '../../../../core/translate'
|
||||
import {overviewStyle} from './overview-page-css.js'
|
||||
import {asyncReplace} from 'lit/directives/async-replace.js'
|
||||
import isElectron from 'is-electron'
|
||||
@ -247,17 +247,9 @@ class OverviewPage extends LitElement {
|
||||
const findMyMintingRecipient = this.listAccounts.find((myKey) => myKey.recipientAccount === address)
|
||||
const findRemovedSponsorsKey = this.listAccounts.filter((my) => my.address)
|
||||
|
||||
if (findMyMintingAccount === undefined) {
|
||||
this.check1 = false
|
||||
} else {
|
||||
this.check1 = true
|
||||
}
|
||||
this.check1 = findMyMintingAccount !== undefined;
|
||||
|
||||
if (findMyMintingRecipient === undefined) {
|
||||
this.check2 = false
|
||||
} else {
|
||||
this.check2 = true
|
||||
}
|
||||
this.check2 = findMyMintingRecipient !== undefined;
|
||||
|
||||
if (findRemovedSponsorsKey.length > 0) {
|
||||
this.removeBlankKey(findRemovedSponsorsKey.publicKey)
|
||||
@ -611,7 +603,7 @@ class StartMintingNow extends LitElement {
|
||||
this.getMintingAcccounts()
|
||||
} catch (error) {
|
||||
this.errorMsg = this.renderErrorMsg3()
|
||||
return
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -732,7 +724,7 @@ class StartMintingNow extends LitElement {
|
||||
this.confirmRelationship(publicAddress)
|
||||
} catch (error) {
|
||||
this.errorMsg = error.data.message || this.renderErrorMsg4()
|
||||
return
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit'
|
||||
import {render} from 'lit/html.js'
|
||||
import {Epml} from '../../../epml.js'
|
||||
import isElectron from 'is-electron'
|
||||
import {registerTranslateConfig, translate, use} from '../../../../core/translate/index.js'
|
||||
import {registerTranslateConfig, translate, use} from '../../../../core/translate'
|
||||
import nacl from '../../../../crypto/api/deps/nacl-fast.js'
|
||||
import Base58 from '../../../../crypto/api/deps/Base58.js'
|
||||
import publicKeyToAddress from '../../../../crypto/api/wallet/publicKeyToAddress.js'
|
||||
|
@ -1,7 +1,7 @@
|
||||
import {css, html, LitElement} from 'lit'
|
||||
import {render} from 'lit/html.js'
|
||||
import {Epml} from '../../../epml.js'
|
||||
import {get, registerTranslateConfig, translate, use} from '../../../../core/translate/index.js'
|
||||
import {get, registerTranslateConfig, translate, use} from '../../../../core/translate'
|
||||
import isElectron from 'is-electron'
|
||||
import '@polymer/paper-spinner/paper-spinner-lite.js'
|
||||
import '@polymer/paper-dialog/paper-dialog.js'
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { css, html, LitElement } from 'lit'
|
||||
import { Epml } from '../../../../epml'
|
||||
import isElectron from 'is-electron'
|
||||
import { get, registerTranslateConfig, translate, use } from '../../../../../core/translate/index.js'
|
||||
import { get, registerTranslateConfig, translate, use } from '../../../../../core/translate'
|
||||
import ShortUniqueId from 'short-unique-id';
|
||||
import FileSaver from 'file-saver'
|
||||
import * as actions from '../../components/qdn-action-types'
|
||||
@ -1547,7 +1547,6 @@ class WebBrowser extends LitElement {
|
||||
reason: errorMsg,
|
||||
identifier: resource.identifier
|
||||
})
|
||||
continue
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
@ -1555,7 +1554,6 @@ class WebBrowser extends LitElement {
|
||||
reason: "Unknown error",
|
||||
identifier: resource.identifier
|
||||
})
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
@ -4164,7 +4162,7 @@ async function showModalAndWait(type, data) {
|
||||
const modalContent = modal.querySelector('.modal-content')
|
||||
modalContent.addEventListener('click', (e) => {
|
||||
e.stopPropagation()
|
||||
return
|
||||
|
||||
})
|
||||
const backdropClick = document.getElementById('backdrop')
|
||||
backdropClick.addEventListener('click', () => {
|
||||
|
@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit'
|
||||
import {render} from 'lit/html.js'
|
||||
import {Epml} from '../../../../epml'
|
||||
import isElectron from 'is-electron'
|
||||
import {get, registerTranslateConfig, translate, use} from '../../../../../core/translate/index.js'
|
||||
import {get, registerTranslateConfig, translate, use} from '../../../../../core/translate'
|
||||
import '@material/mwc-button'
|
||||
import '@material/mwc-dialog'
|
||||
import '@material/mwc-icon'
|
||||
|
@ -1,7 +1,7 @@
|
||||
import {css, html, LitElement} from 'lit'
|
||||
import {Epml} from '../../../../epml'
|
||||
import isElectron from 'is-electron'
|
||||
import {get, registerTranslateConfig, translate, use} from '../../../../../core/translate/index.js'
|
||||
import {get, registerTranslateConfig, translate, use} from '../../../../../core/translate'
|
||||
import '@material/mwc-button'
|
||||
import '@material/mwc-textfield'
|
||||
import '@material/mwc-select'
|
||||
|
@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit'
|
||||
import {render} from 'lit/html.js'
|
||||
import {Epml} from '../../../epml.js'
|
||||
import isElectron from 'is-electron'
|
||||
import {get, registerTranslateConfig, translate, use} from '../../../../core/translate/index.js'
|
||||
import {get, registerTranslateConfig, translate, use} from '../../../../core/translate'
|
||||
import '@material/mwc-dialog'
|
||||
import '@material/mwc-icon'
|
||||
import '@material/mwc-button'
|
||||
|
@ -1,7 +1,7 @@
|
||||
import {css, html, LitElement} from 'lit'
|
||||
import {render} from 'lit/html.js'
|
||||
import {Epml} from '../../../epml.js'
|
||||
import {get, registerTranslateConfig, translate, use} from '../../../../core/translate/index.js'
|
||||
import {get, registerTranslateConfig, translate, use} from '../../../../core/translate'
|
||||
import isElectron from 'is-electron'
|
||||
import '@material/mwc-button'
|
||||
import '@material/mwc-dialog'
|
||||
@ -480,20 +480,20 @@ class QortalLottery extends LitElement {
|
||||
})
|
||||
})
|
||||
|
||||
await this.openLotteries.map(item => {
|
||||
const aTT = item.ATAddress
|
||||
const endHeight = item.sleepUntilHeight
|
||||
const newObj = {
|
||||
ATAddress: aTT,
|
||||
sleepUntilHeight: endHeight
|
||||
}
|
||||
this.openLotteriesAtArray.push(newObj)
|
||||
})
|
||||
this.openLotteries.map(item => {
|
||||
const aTT = item.ATAddress
|
||||
const endHeight = item.sleepUntilHeight
|
||||
const newObj = {
|
||||
ATAddress: aTT,
|
||||
sleepUntilHeight: endHeight
|
||||
}
|
||||
this.openLotteriesAtArray.push(newObj)
|
||||
})
|
||||
|
||||
await this.closedLotteries.map(item => {
|
||||
const myAT = item.ATAddress
|
||||
this.closedLotteriesAtArray.push(myAT)
|
||||
})
|
||||
this.closedLotteries.map(item => {
|
||||
const myAT = item.ATAddress
|
||||
this.closedLotteriesAtArray.push(myAT)
|
||||
})
|
||||
|
||||
const appDelay = ms => new Promise(res => setTimeout(res, ms))
|
||||
await appDelay(1000)
|
||||
@ -502,37 +502,37 @@ class QortalLottery extends LitElement {
|
||||
async getOpenLotteries() {
|
||||
let prepareOpenLotteriesArray = []
|
||||
|
||||
await this.openLotteriesAtArray.map(item => {
|
||||
parentEpml.request('apiCall', {
|
||||
url: `/transactions/address/${item.ATAddress}?limit=0&reverse=true`
|
||||
}).then(res => {
|
||||
this.openLotteriesFilterTx1 = []
|
||||
this.openLotteriesFilterTx2 = []
|
||||
this.openLotteriesFilterTx = res.filter(function (da) {
|
||||
return da.type === "DEPLOY_AT"
|
||||
})
|
||||
this.openLotteriesFilterTx2 = res.filter(function (pm) {
|
||||
return pm.type === "PAYMENT"
|
||||
})
|
||||
this.openLotteriesFilterTx.map(item2 => {
|
||||
const sleep = item.sleepUntilHeight
|
||||
const desc = item2.description
|
||||
const start = item2.blockHeight
|
||||
const ata = item2.aTAddress
|
||||
const amount = item2.tags
|
||||
const players = this.openLotteriesFilterTx2.length
|
||||
const obj = {
|
||||
description: desc,
|
||||
startBlock: start,
|
||||
endBlock: sleep,
|
||||
aTAddress: ata,
|
||||
joined: players,
|
||||
enter: amount
|
||||
}
|
||||
prepareOpenLotteriesArray.push(obj)
|
||||
})
|
||||
})
|
||||
})
|
||||
this.openLotteriesAtArray.map(item => {
|
||||
parentEpml.request('apiCall', {
|
||||
url: `/transactions/address/${item.ATAddress}?limit=0&reverse=true`
|
||||
}).then(res => {
|
||||
this.openLotteriesFilterTx1 = []
|
||||
this.openLotteriesFilterTx2 = []
|
||||
this.openLotteriesFilterTx = res.filter(function (da) {
|
||||
return da.type === "DEPLOY_AT"
|
||||
})
|
||||
this.openLotteriesFilterTx2 = res.filter(function (pm) {
|
||||
return pm.type === "PAYMENT"
|
||||
})
|
||||
this.openLotteriesFilterTx.map(item2 => {
|
||||
const sleep = item.sleepUntilHeight
|
||||
const desc = item2.description
|
||||
const start = item2.blockHeight
|
||||
const ata = item2.aTAddress
|
||||
const amount = item2.tags
|
||||
const players = this.openLotteriesFilterTx2.length
|
||||
const obj = {
|
||||
description: desc,
|
||||
startBlock: start,
|
||||
endBlock: sleep,
|
||||
aTAddress: ata,
|
||||
joined: players,
|
||||
enter: amount
|
||||
}
|
||||
prepareOpenLotteriesArray.push(obj)
|
||||
})
|
||||
})
|
||||
})
|
||||
const appDelay = ms => new Promise(res => setTimeout(res, ms))
|
||||
await appDelay(2000)
|
||||
this.openLotteriesArray = prepareOpenLotteriesArray
|
||||
@ -543,55 +543,55 @@ class QortalLottery extends LitElement {
|
||||
async getFinishedLotteries() {
|
||||
let prepareClosedLotteriesArray = []
|
||||
|
||||
await this.closedLotteriesAtArray.map(item => {
|
||||
parentEpml.request('apiCall', {
|
||||
url: `/transactions/address/${item}?limit=0&reverse=true`
|
||||
}).then(res => {
|
||||
this.closedLotteriesFilterTx1 = []
|
||||
this.closedLotteriesFilterTx2 = []
|
||||
this.closedLotteriesFilterTx1 = res.filter(function (el) {
|
||||
return el.type === "DEPLOY_AT"
|
||||
})
|
||||
this.closedLotteriesFilterTx2 = res.filter(function (el) {
|
||||
return el.type === "AT"
|
||||
})
|
||||
this.closedLotteriesAtArray.map(item => {
|
||||
parentEpml.request('apiCall', {
|
||||
url: `/transactions/address/${item}?limit=0&reverse=true`
|
||||
}).then(res => {
|
||||
this.closedLotteriesFilterTx1 = []
|
||||
this.closedLotteriesFilterTx2 = []
|
||||
this.closedLotteriesFilterTx1 = res.filter(function (el) {
|
||||
return el.type === "DEPLOY_AT"
|
||||
})
|
||||
this.closedLotteriesFilterTx2 = res.filter(function (el) {
|
||||
return el.type === "AT"
|
||||
})
|
||||
|
||||
this.closedLotteriesFilterTx2.map(item1 => {
|
||||
const twinner = item1.recipient
|
||||
const tjackpot = item1.amount
|
||||
const tendblock = item1.blockHeight
|
||||
this.closedLotteriesFilterTx1.map(item2 => {
|
||||
const tstartblock = item2.blockHeight
|
||||
const tdescription = item2.description
|
||||
parentEpml.request('apiCall', {
|
||||
url: `/names/address/${twinner}?limit=0&reverse=true`
|
||||
}).then(res => {
|
||||
if (res.length) {
|
||||
const winName = res[0].name
|
||||
const obj = {
|
||||
description: tdescription,
|
||||
startblock: tstartblock,
|
||||
endblock: tendblock,
|
||||
winner: winName,
|
||||
jackpot: tjackpot
|
||||
}
|
||||
prepareClosedLotteriesArray.push(obj)
|
||||
} else {
|
||||
const winName = twinner
|
||||
const obj = {
|
||||
description: tdescription,
|
||||
startblock: tstartblock,
|
||||
endblock: tendblock,
|
||||
winner: winName,
|
||||
jackpot: tjackpot
|
||||
}
|
||||
prepareClosedLotteriesArray.push(obj)
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
this.closedLotteriesFilterTx2.map(item1 => {
|
||||
const twinner = item1.recipient
|
||||
const tjackpot = item1.amount
|
||||
const tendblock = item1.blockHeight
|
||||
this.closedLotteriesFilterTx1.map(item2 => {
|
||||
const tstartblock = item2.blockHeight
|
||||
const tdescription = item2.description
|
||||
parentEpml.request('apiCall', {
|
||||
url: `/names/address/${twinner}?limit=0&reverse=true`
|
||||
}).then(res => {
|
||||
if (res.length) {
|
||||
const winName = res[0].name
|
||||
const obj = {
|
||||
description: tdescription,
|
||||
startblock: tstartblock,
|
||||
endblock: tendblock,
|
||||
winner: winName,
|
||||
jackpot: tjackpot
|
||||
}
|
||||
prepareClosedLotteriesArray.push(obj)
|
||||
} else {
|
||||
const winName = twinner
|
||||
const obj = {
|
||||
description: tdescription,
|
||||
startblock: tstartblock,
|
||||
endblock: tendblock,
|
||||
winner: winName,
|
||||
jackpot: tjackpot
|
||||
}
|
||||
prepareClosedLotteriesArray.push(obj)
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
const appDelay = ms => new Promise(res => setTimeout(res, ms))
|
||||
await appDelay(5000)
|
||||
this.closedLotteriesArray = prepareClosedLotteriesArray
|
||||
|
@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit'
|
||||
import {render} from 'lit/html.js'
|
||||
import {Epml} from '../../../epml.js'
|
||||
import isElectron from 'is-electron'
|
||||
import {get, registerTranslateConfig, translate, use} from '../../../../core/translate/index.js'
|
||||
import {get, registerTranslateConfig, translate, use} from '../../../../core/translate'
|
||||
import '@material/mwc-icon'
|
||||
import '@material/mwc-button'
|
||||
import '@material/mwc-textfield'
|
||||
|
@ -1,6 +1,6 @@
|
||||
import {html, LitElement} from 'lit'
|
||||
import {Epml} from '../../../epml.js'
|
||||
import {get, registerTranslateConfig, translate, use} from '../../../../core/translate/index.js'
|
||||
import {get, registerTranslateConfig, translate, use} from '../../../../core/translate'
|
||||
import {blocksNeed} from '../../utils/blocks-needed.js'
|
||||
import {asyncReplace} from 'lit/directives/async-replace.js'
|
||||
import {pageStyles} from './sponsorship-list-css.src.js'
|
||||
@ -721,13 +721,13 @@ class SponsorshipList extends LitElement {
|
||||
}
|
||||
|
||||
const getTxnRequestResponse = (txnResponse) => {
|
||||
|
||||
|
||||
const extraData = txnResponse && txnResponse.extraData;
|
||||
const data = txnResponse && txnResponse.data;
|
||||
const dataMessage = data && data.message;
|
||||
const extraDataPrivateKey = extraData && extraData.rewardSharePrivateKey;
|
||||
const txnSuccess = txnResponse && txnResponse.success;
|
||||
|
||||
|
||||
if (extraDataPrivateKey && typeof dataMessage === 'string' &&
|
||||
(dataMessage.includes('multiple') || dataMessage.includes('SELF_SHARE_EXISTS'))) {
|
||||
this.privateRewardShareKey = extraDataPrivateKey;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user