forked from Qortal/qortal-ui
Optimize imports
This commit is contained in:
parent
c12f7859b5
commit
0186fe2814
@ -1,4 +1,4 @@
|
|||||||
import { html } from 'lit'
|
import {html} from 'lit'
|
||||||
|
|
||||||
export const svgSun = html`<svg height="64px" style="shape-rendering:geometricPrecision;text-rendering:geometricPrecision;image-rendering:optimizeQuality;fill-rule:evenodd;clip-rule:evenodd;width: 32px;" version="1.1" viewBox="0 0 64 64" width="64px" xml:space="preserve"><defs><style type="text/css">.str0 {stroke:#FFC106;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:22.9256} .fil1 {fill:none} .fil0 {fill:#FFC106}</style></defs><g id="Layer_x0020_1"><g id="_866321920"><circle class="fil0" r="22.97" transform="matrix(0.543121 0.145529 -0.145529 0.543121 32.0002 31.9993)"/><path class="fil1 str0" d="M32 12.4c0,1.52 0,2 0,2m-9.8 0.63c0.76,1.32 1,1.73 1,1.73m-8.17 5.44c1.32,0.76 1.73,1 1.73,1m-4.36 8.8c1.53,0 2,0 2,0m0.63 9.8c1.32,-0.76 1.73,-1 1.73,-1m5.44 8.17c0.76,-1.32 1,-1.73 1,-1.73m8.8 4.36c0,-1.53 0,-2 0,-2m9.8 -0.63c-0.76,-1.32 -1,-1.73 -1,-1.73m8.17 -5.44c-1.32,-0.76 -1.73,-1 -1.73,-1m4.36 -8.8c-1.53,0 -2,0 -2,0m-0.63 -9.8c-1.32,0.76 -1.73,1 -1.73,1m-5.44 -8.17c-0.76,1.32 -1,1.73 -1,1.73"/></g></g></svg>`;
|
export const svgSun = html`<svg height="64px" style="shape-rendering:geometricPrecision;text-rendering:geometricPrecision;image-rendering:optimizeQuality;fill-rule:evenodd;clip-rule:evenodd;width: 32px;" version="1.1" viewBox="0 0 64 64" width="64px" xml:space="preserve"><defs><style type="text/css">.str0 {stroke:#FFC106;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:22.9256} .fil1 {fill:none} .fil0 {fill:#FFC106}</style></defs><g id="Layer_x0020_1"><g id="_866321920"><circle class="fil0" r="22.97" transform="matrix(0.543121 0.145529 -0.145529 0.543121 32.0002 31.9993)"/><path class="fil1 str0" d="M32 12.4c0,1.52 0,2 0,2m-9.8 0.63c0.76,1.32 1,1.73 1,1.73m-8.17 5.44c1.32,0.76 1.73,1 1.73,1m-4.36 8.8c1.53,0 2,0 2,0m0.63 9.8c1.32,-0.76 1.73,-1 1.73,-1m5.44 8.17c0.76,-1.32 1,-1.73 1,-1.73m8.8 4.36c0,-1.53 0,-2 0,-2m9.8 -0.63c-0.76,-1.32 -1,-1.73 -1,-1.73m8.17 -5.44c-1.32,-0.76 -1.73,-1 -1.73,-1m4.36 -8.8c-1.53,0 -2,0 -2,0m-0.63 -9.8c-1.32,0.76 -1.73,1 -1.73,1m-5.44 -8.17c-0.76,1.32 -1,1.73 -1,1.73"/></g></g></svg>`;
|
||||||
export const svgMoon = html `<svg height="32px" style="enable-background:new 0 0 32 32;" version="1.1" viewBox="0 0 32 32" width="32px" xml:space="preserve"><g id="Layer_1"/><g id="moon_x5F_fill"><g><path d="M24.633,22.184c-8.188,0-14.82-6.637-14.82-14.82c0-2.695,0.773-5.188,2.031-7.363 C5.02,1.969,0,8.188,0,15.645C0,24.676,7.32,32,16.352,32c7.457,0,13.68-5.023,15.648-11.844 C29.82,21.41,27.328,22.184,24.633,22.184z" style="fill:#4E4E50;"/></g></g></svg>`;
|
export const svgMoon = html `<svg height="32px" style="enable-background:new 0 0 32 32;" version="1.1" viewBox="0 0 32 32" width="32px" xml:space="preserve"><g id="Layer_1"/><g id="moon_x5F_fill"><g><path d="M24.633,22.184c-8.188,0-14.82-6.637-14.82-14.82c0-2.695,0.773-5.188,2.031-7.363 C5.02,1.969,0,8.188,0,15.645C0,24.676,7.32,32,16.352,32c7.457,0,13.68-5.023,15.648-11.844 C29.82,21.41,27.328,22.184,24.633,22.184z" style="fill:#4E4E50;"/></g></g></svg>`;
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import { LitElement, html, css } 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 { doPageUrl } from '../redux/app/app-actions.js'
|
import {doPageUrl} from '../redux/app/app-actions.js'
|
||||||
import { translate, translateUnsafeHTML } from 'lit-translate'
|
import {translate} from 'lit-translate'
|
||||||
import WebWorker from 'web-worker:./computePowWorker.js';
|
import WebWorker from 'web-worker:./computePowWorker.js';
|
||||||
import { routes } from '../plugins/routes.js';
|
import {routes} from '../plugins/routes.js';
|
||||||
|
|
||||||
import '@material/mwc-icon'
|
import '@material/mwc-icon'
|
||||||
import '@material/mwc-button'
|
import '@material/mwc-button'
|
||||||
@ -124,7 +124,7 @@ class AppInfo extends connect(store)(LitElement) {
|
|||||||
// } catch (error) {
|
// } catch (error) {
|
||||||
// console.error(error)
|
// console.error(error)
|
||||||
// }
|
// }
|
||||||
|
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
this.getNodeInfo()
|
this.getNodeInfo()
|
||||||
this.getCoreInfo()
|
this.getCoreInfo()
|
||||||
@ -198,13 +198,13 @@ class AppInfo extends connect(store)(LitElement) {
|
|||||||
lastReference: reference,
|
lastReference: reference,
|
||||||
proofOfWorkNonce: 0,
|
proofOfWorkNonce: 0,
|
||||||
fee: 0,
|
fee: 0,
|
||||||
timestamp: Date.now(),
|
timestamp: Date.now(),
|
||||||
},
|
},
|
||||||
disableModal: true
|
disableModal: true
|
||||||
},
|
},
|
||||||
disableModal: true,
|
disableModal: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const powRes = await _computePow2(chatRes)
|
const powRes = await _computePow2(chatRes)
|
||||||
if(powRes === true) {
|
if(powRes === true) {
|
||||||
@ -216,7 +216,7 @@ class AppInfo extends connect(store)(LitElement) {
|
|||||||
console.error(error)
|
console.error(error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!data.error && data !== 'false' && data) {
|
if (!data.error && data !== 'false' && data) {
|
||||||
clearInterval(this.interval)
|
clearInterval(this.interval)
|
||||||
localStorage.removeItem(this.publicizeAddress)
|
localStorage.removeItem(this.publicizeAddress)
|
||||||
|
@ -1,18 +1,13 @@
|
|||||||
import { LitElement, html, css } 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 { Epml } from '../epml.js'
|
import {Epml} from '../epml.js'
|
||||||
import { addTradeBotRoutes } from '../tradebot/addTradeBotRoutes.js'
|
import {addTradeBotRoutes} from '../tradebot/addTradeBotRoutes.js'
|
||||||
import { get, translate, translateUnsafeHTML } from 'lit-translate'
|
import {get, translate} from 'lit-translate'
|
||||||
import localForage from 'localforage'
|
import localForage from 'localforage'
|
||||||
import { encryptData, decryptData } 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'
|
||||||
import isElectron from 'is-electron'
|
import isElectron from 'is-electron'
|
||||||
|
|
||||||
const chatLastSeen = localForage.createInstance({
|
|
||||||
name: "chat-last-seen",
|
|
||||||
})
|
|
||||||
|
|
||||||
import '@material/mwc-button'
|
import '@material/mwc-button'
|
||||||
import '@material/mwc-icon'
|
import '@material/mwc-icon'
|
||||||
import '@polymer/paper-icon-button/paper-icon-button.js'
|
import '@polymer/paper-icon-button/paper-icon-button.js'
|
||||||
@ -47,6 +42,11 @@ import './friends-view/friends-side-panel-parent.js'
|
|||||||
import './friends-view/save-settings-qdn.js'
|
import './friends-view/save-settings-qdn.js'
|
||||||
import './friends-view/core-sync-status.js'
|
import './friends-view/core-sync-status.js'
|
||||||
import './controllers/coin-balances-controller.js'
|
import './controllers/coin-balances-controller.js'
|
||||||
|
|
||||||
|
const chatLastSeen = localForage.createInstance({
|
||||||
|
name: "chat-last-seen",
|
||||||
|
})
|
||||||
|
|
||||||
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
|
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
|
||||||
|
|
||||||
class AppView extends connect(store)(LitElement) {
|
class AppView extends connect(store)(LitElement) {
|
||||||
@ -230,13 +230,13 @@ class AppView extends connect(store)(LitElement) {
|
|||||||
background-color: whitesmoke;
|
background-color: whitesmoke;
|
||||||
border-radius: 7px;
|
border-radius: 7px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sideBarMenu::-webkit-scrollbar {
|
.sideBarMenu::-webkit-scrollbar {
|
||||||
width: 6px;
|
width: 6px;
|
||||||
border-radius: 7px;
|
border-radius: 7px;
|
||||||
background-color: whitesmoke;
|
background-color: whitesmoke;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sideBarMenu::-webkit-scrollbar-thumb {
|
.sideBarMenu::-webkit-scrollbar-thumb {
|
||||||
background-color: rgb(180, 176, 176);
|
background-color: rgb(180, 176, 176);
|
||||||
border-radius: 7px;
|
border-radius: 7px;
|
||||||
@ -363,7 +363,7 @@ class AppView extends connect(store)(LitElement) {
|
|||||||
0%,100% { opacity: 0; }
|
0%,100% { opacity: 0; }
|
||||||
50% { opacity: 10; }
|
50% { opacity: 10; }
|
||||||
}
|
}
|
||||||
|
|
||||||
.sideBarMenu::-webkit-scrollbar-thumb:hover {
|
.sideBarMenu::-webkit-scrollbar-thumb:hover {
|
||||||
background-color: rgb(148, 146, 146);
|
background-color: rgb(148, 146, 146);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
@ -1837,7 +1837,7 @@ class AppView extends connect(store)(LitElement) {
|
|||||||
<side-menu-item id="qbminter" label="${translate('sidemenu.becomeAMinter')}" href="/app/become-minter" ?hide=${isMinter}>
|
<side-menu-item id="qbminter" label="${translate('sidemenu.becomeAMinter')}" href="/app/become-minter" ?hide=${isMinter}>
|
||||||
<vaadin-icon icon="vaadin:thumbs-up" slot="icon"></vaadin-icon>
|
<vaadin-icon icon="vaadin:thumbs-up" slot="icon"></vaadin-icon>
|
||||||
</side-menu-item>
|
</side-menu-item>
|
||||||
|
|
||||||
<side-menu-item id="qiminter" label="${translate('mintingpage.mchange35')}" href="/app/sponsorship-list" ?hide=${!isSponsor}>
|
<side-menu-item id="qiminter" label="${translate('mintingpage.mchange35')}" href="/app/sponsorship-list" ?hide=${!isSponsor}>
|
||||||
<vaadin-icon icon="vaadin:list-ol" slot="icon"></vaadin-icon>
|
<vaadin-icon icon="vaadin:list-ol" slot="icon"></vaadin-icon>
|
||||||
</side-menu-item>
|
</side-menu-item>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { LitElement, html, css } 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'
|
||||||
|
|
||||||
class MyElement extends connect(store)(LitElement) {
|
class MyElement extends connect(store)(LitElement) {
|
||||||
static get properties () {
|
static get properties () {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { LitElement, html, css } from 'lit'
|
import {css, html, LitElement} from 'lit'
|
||||||
import { get, translate, translateUnsafeHTML } from 'lit-translate'
|
import {translate} from 'lit-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'
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Sha256 } from 'asmcrypto.js'
|
import {Sha256} from 'asmcrypto.js'
|
||||||
|
|
||||||
|
|
||||||
function sbrk(size, heap){
|
function sbrk(size, heap){
|
||||||
@ -39,7 +39,7 @@ const computePow = async (chatBytes, path, difficulty) => {
|
|||||||
const hashAry = new Uint8Array(memory.buffer, hashPtr, 32);
|
const hashAry = new Uint8Array(memory.buffer, hashPtr, 32);
|
||||||
hashAry.set(chatBytesHash);
|
hashAry.set(chatBytesHash);
|
||||||
|
|
||||||
|
|
||||||
const workBufferLength = 8 * 1024 * 1024;
|
const workBufferLength = 8 * 1024 * 1024;
|
||||||
const workBufferPtr = sbrk(workBufferLength, heap);
|
const workBufferPtr = sbrk(workBufferLength, heap);
|
||||||
|
|
||||||
@ -72,11 +72,11 @@ loadWebAssembly(path)
|
|||||||
}
|
}
|
||||||
|
|
||||||
resolve()
|
resolve()
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
return response
|
return response
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
import { LitElement, html, css } from 'lit';
|
import {html, LitElement} from 'lit';
|
||||||
import '@material/mwc-icon';
|
import '@material/mwc-icon';
|
||||||
import { store } from '../../store';
|
import {store} from '../../store';
|
||||||
import { connect } from 'pwa-helpers';
|
import {connect} from 'pwa-helpers';
|
||||||
import '@vaadin/tooltip';
|
import '@vaadin/tooltip';
|
||||||
import { get } from 'lit-translate';
|
import {parentEpml} from '../show-plugin';
|
||||||
import { parentEpml } from '../show-plugin';
|
import {setCoinBalances} from '../../redux/app/app-actions';
|
||||||
import { setCoinBalances } from '../../redux/app/app-actions';
|
|
||||||
|
|
||||||
class CoinBalancesController extends connect(store)(LitElement) {
|
class CoinBalancesController extends connect(store)(LitElement) {
|
||||||
static get properties() {
|
static get properties() {
|
||||||
@ -43,7 +42,7 @@ class CoinBalancesController extends connect(store)(LitElement) {
|
|||||||
return myNode;
|
return myNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async updateArrrWalletBalance() {
|
async updateArrrWalletBalance() {
|
||||||
let _url = `/crosschain/arrr/walletbalance?apiKey=${this.myNode.apiKey}`
|
let _url = `/crosschain/arrr/walletbalance?apiKey=${this.myNode.apiKey}`
|
||||||
let _body = store.getState().app.selectedAddress.arrrWallet.seed58
|
let _body = store.getState().app.selectedAddress.arrrWallet.seed58
|
||||||
@ -205,7 +204,7 @@ class CoinBalancesController extends connect(store)(LitElement) {
|
|||||||
fullValue: Number(res)
|
fullValue: Number(res)
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
}).catch(()=> {
|
}).catch(()=> {
|
||||||
console.log('error')
|
console.log('error')
|
||||||
@ -233,7 +232,7 @@ class CoinBalancesController extends connect(store)(LitElement) {
|
|||||||
this.updateArrrWalletBalance()
|
this.updateArrrWalletBalance()
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
copyCoinList[coin] = Date.now() + 120000;
|
copyCoinList[coin] = Date.now() + 120000;
|
||||||
@ -264,9 +263,9 @@ class CoinBalancesController extends connect(store)(LitElement) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
await Promise.all(getCoinBalances);
|
await Promise.all(getCoinBalances);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async fetchBalance(){
|
async fetchBalance(){
|
||||||
try {
|
try {
|
||||||
let arrayOfCoins = []
|
let arrayOfCoins = []
|
||||||
@ -303,7 +302,7 @@ class CoinBalancesController extends connect(store)(LitElement) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
disconnectedCallback() {
|
disconnectedCallback() {
|
||||||
|
|
||||||
super.disconnectedCallback();
|
super.disconnectedCallback();
|
||||||
window.removeEventListener(
|
window.removeEventListener(
|
||||||
'ping-coin-controller-with-coin',
|
'ping-coin-controller-with-coin',
|
||||||
@ -316,7 +315,7 @@ class CoinBalancesController extends connect(store)(LitElement) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return html``;
|
return html``;
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { LitElement, html, css } from 'lit'
|
import {css, html, LitElement} from 'lit'
|
||||||
import { render } from 'lit/html.js'
|
import {get} from 'lit-translate'
|
||||||
import { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from 'lit-translate'
|
|
||||||
import '@material/mwc-icon'
|
import '@material/mwc-icon'
|
||||||
import '@vaadin/tooltip';
|
import '@vaadin/tooltip';
|
||||||
|
|
||||||
@ -100,7 +99,7 @@ class ChatSideNavHeads extends LitElement {
|
|||||||
imageHTMLRes.onload = () => {
|
imageHTMLRes.onload = () => {
|
||||||
this.isImageLoaded = true;
|
this.isImageLoaded = true;
|
||||||
}
|
}
|
||||||
imageHTMLRes.onerror = () => {
|
imageHTMLRes.onerror = () => {
|
||||||
if (this.imageFetches < 4) {
|
if (this.imageFetches < 4) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.imageFetches = this.imageFetches + 1;
|
this.imageFetches = this.imageFetches + 1;
|
||||||
@ -170,13 +169,13 @@ class ChatSideNavHeads extends LitElement {
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div style="display:flex; align-items: center">
|
<div style="display:flex; align-items: center">
|
||||||
${this.chatInfo.willFollow ? html`
|
${this.chatInfo.willFollow ? html`
|
||||||
<mwc-icon id="willFollowIcon" style="color: var(--black)">connect_without_contact</mwc-icon>
|
<mwc-icon id="willFollowIcon" style="color: var(--black)">connect_without_contact</mwc-icon>
|
||||||
<vaadin-tooltip
|
<vaadin-tooltip
|
||||||
|
|
||||||
for="willFollowIcon"
|
for="willFollowIcon"
|
||||||
position="top"
|
position="top"
|
||||||
hover-delay=${200}
|
hover-delay=${200}
|
||||||
@ -210,10 +209,10 @@ class ChatSideNavHeads extends LitElement {
|
|||||||
if(changedProperties.has('isImageLoaded')){
|
if(changedProperties.has('isImageLoaded')){
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
getUrl(chatUrl) {
|
getUrl(chatUrl) {
|
||||||
this.setActiveChatHeadUrl(chatUrl)
|
this.setActiveChatHeadUrl(chatUrl)
|
||||||
}
|
}
|
||||||
|
@ -1,17 +1,10 @@
|
|||||||
import { LitElement, html, css } from 'lit';
|
import {css, html, LitElement} from 'lit';
|
||||||
import { render } from 'lit/html.js';
|
import {translate,} from 'lit-translate';
|
||||||
import {
|
|
||||||
use,
|
|
||||||
get,
|
|
||||||
translate,
|
|
||||||
translateUnsafeHTML,
|
|
||||||
registerTranslateConfig,
|
|
||||||
} from 'lit-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';
|
||||||
import { connect } from 'pwa-helpers';
|
import {connect} from 'pwa-helpers';
|
||||||
import { store } from '../../store';
|
import {store} from '../../store';
|
||||||
import '@polymer/paper-spinner/paper-spinner-lite.js'
|
import '@polymer/paper-spinner/paper-spinner-lite.js'
|
||||||
|
|
||||||
class AddFriendsModal extends connect(store)(LitElement) {
|
class AddFriendsModal extends connect(store)(LitElement) {
|
||||||
@ -235,7 +228,7 @@ class AddFriendsModal extends connect(store)(LitElement) {
|
|||||||
notes: this.notes,
|
notes: this.notes,
|
||||||
willFollow: this.willFollow,
|
willFollow: this.willFollow,
|
||||||
mySelectedFeeds: this.mySelectedFeeds
|
mySelectedFeeds: this.mySelectedFeeds
|
||||||
|
|
||||||
});
|
});
|
||||||
this.clearFields();
|
this.clearFields();
|
||||||
this.onClose();
|
this.onClose();
|
||||||
@ -303,7 +296,7 @@ class AddFriendsModal extends connect(store)(LitElement) {
|
|||||||
render() {
|
render() {
|
||||||
return html`
|
return html`
|
||||||
<div class="modal-overlay ${this.isOpen ? '' : 'hidden'}">
|
<div class="modal-overlay ${this.isOpen ? '' : 'hidden'}">
|
||||||
|
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="inner-content">
|
<div class="inner-content">
|
||||||
<div style="text-align:center">
|
<div style="text-align:center">
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { Sha256 } from 'asmcrypto.js'
|
import {Sha256} from 'asmcrypto.js'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function sbrk(size, heap){
|
function sbrk(size, heap){
|
||||||
@ -19,7 +18,7 @@ function sbrk(size, heap){
|
|||||||
self.addEventListener('message', async e => {
|
self.addEventListener('message', async e => {
|
||||||
const response = await computePow(e.data.convertedBytes, e.data.path)
|
const response = await computePow(e.data.convertedBytes, e.data.path)
|
||||||
postMessage(response)
|
postMessage(response)
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
@ -79,14 +78,14 @@ loadWebAssembly(path)
|
|||||||
.then(wasmModule => {
|
.then(wasmModule => {
|
||||||
response = {
|
response = {
|
||||||
nonce : wasmModule.exports.compute2(hashPtr, workBufferPtr, workBufferLength, difficulty),
|
nonce : wasmModule.exports.compute2(hashPtr, workBufferPtr, workBufferLength, difficulty),
|
||||||
|
|
||||||
}
|
}
|
||||||
resolve()
|
resolve()
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
return response
|
return response
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { LitElement, html, css } 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 'lit-translate'
|
import {translate} from 'lit-translate'
|
||||||
|
|
||||||
class CoreSyncStatus extends connect(store)(LitElement) {
|
class CoreSyncStatus extends connect(store)(LitElement) {
|
||||||
static get properties() {
|
static get properties() {
|
||||||
|
@ -1,16 +1,13 @@
|
|||||||
import { LitElement, html, css } from 'lit';
|
import {css, html, LitElement} from 'lit';
|
||||||
import {
|
import {translate,} from 'lit-translate';
|
||||||
get,
|
|
||||||
translate,
|
|
||||||
} from 'lit-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'
|
||||||
import { RequestQueueWithPromise } from '../../../../plugins/plugins/utils/queue';
|
import {RequestQueueWithPromise} from '../../../../plugins/plugins/utils/queue';
|
||||||
import '../../../../plugins/plugins/core/components/TimeAgo'
|
import '../../../../plugins/plugins/core/components/TimeAgo'
|
||||||
import { connect } from 'pwa-helpers';
|
import {connect} from 'pwa-helpers';
|
||||||
import { store } from '../../store';
|
import {store} from '../../store';
|
||||||
import { setNewTab } from '../../redux/app/app-actions';
|
import {setNewTab} from '../../redux/app/app-actions';
|
||||||
import ShortUniqueId from 'short-unique-id';
|
import ShortUniqueId from 'short-unique-id';
|
||||||
|
|
||||||
const requestQueue = new RequestQueueWithPromise(3);
|
const requestQueue = new RequestQueueWithPromise(3);
|
||||||
@ -41,9 +38,9 @@ export class FeedItem extends connect(store)(LitElement) {
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
img {
|
img {
|
||||||
width:100%;
|
width:100%;
|
||||||
max-height:30vh;
|
max-height:30vh;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
@ -67,7 +64,7 @@ export class FeedItem extends connect(store)(LitElement) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.defaultSize {
|
.defaultSize {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 160px;
|
height: 160px;
|
||||||
}
|
}
|
||||||
.parent-feed-item {
|
.parent-feed-item {
|
||||||
@ -87,7 +84,7 @@ export class FeedItem extends connect(store)(LitElement) {
|
|||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
.avatar {
|
.avatar {
|
||||||
width: 36px;
|
width: 36px;
|
||||||
height: 36px;
|
height: 36px;
|
||||||
border-radius:50%;
|
border-radius:50%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@ -95,7 +92,7 @@ export class FeedItem extends connect(store)(LitElement) {
|
|||||||
align-items:center;
|
align-items:center;
|
||||||
}
|
}
|
||||||
.avatarApp {
|
.avatarApp {
|
||||||
width: 30px;
|
width: 30px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
border-radius:50%;
|
border-radius:50%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@ -210,7 +207,7 @@ getMyNode(){
|
|||||||
async fetchVideoUrl() {
|
async fetchVideoUrl() {
|
||||||
|
|
||||||
this.fetchResource()
|
this.fetchResource()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async getRawData(){
|
async getRawData(){
|
||||||
@ -228,7 +225,7 @@ getMyNode(){
|
|||||||
// const responseData2 = await response2.json()
|
// const responseData2 = await response2.json()
|
||||||
// return responseData2
|
// return responseData2
|
||||||
}
|
}
|
||||||
|
|
||||||
updateDisplayWithPlaceholders(display, resource, rawdata) {
|
updateDisplayWithPlaceholders(display, resource, rawdata) {
|
||||||
const pattern = /\$\$\{([a-zA-Z0-9_\.]+)\}\$\$/g;
|
const pattern = /\$\$\{([a-zA-Z0-9_\.]+)\}\$\$/g;
|
||||||
|
|
||||||
@ -241,7 +238,7 @@ getMyNode(){
|
|||||||
if (rawdata[dataKey] === undefined) {
|
if (rawdata[dataKey] === undefined) {
|
||||||
console.error("rawdata key not found:", dataKey);
|
console.error("rawdata key not found:", dataKey);
|
||||||
}
|
}
|
||||||
return rawdata[dataKey] || match;
|
return rawdata[dataKey] || match;
|
||||||
} else if (p1.startsWith('resource.')) {
|
} else if (p1.startsWith('resource.')) {
|
||||||
const resourceKey = p1.split('.')[1];
|
const resourceKey = p1.split('.')[1];
|
||||||
if (resource[resourceKey] === undefined) {
|
if (resource[resourceKey] === undefined) {
|
||||||
@ -263,7 +260,7 @@ getMyNode(){
|
|||||||
let timer = 24
|
let timer = 24
|
||||||
const response = await requestQueueStatus.enqueue(()=> {
|
const response = await requestQueueStatus.enqueue(()=> {
|
||||||
return axios.get(`${this.nodeUrl}/arbitrary/resource/status/${this.resource.service}/${this.resource.name}/${this.resource.identifier}?apiKey=${this.myNode.apiKey}`)
|
return axios.get(`${this.nodeUrl}/arbitrary/resource/status/${this.resource.service}/${this.resource.name}/${this.resource.identifier}?apiKey=${this.myNode.apiKey}`)
|
||||||
})
|
})
|
||||||
if(response && response.data && response.data.status === 'READY'){
|
if(response && response.data && response.data.status === 'READY'){
|
||||||
const rawData = await this.getRawData()
|
const rawData = await this.getRawData()
|
||||||
const object = {
|
const object = {
|
||||||
@ -272,13 +269,13 @@ getMyNode(){
|
|||||||
this.updateDisplayWithPlaceholders(object, {},rawData.data)
|
this.updateDisplayWithPlaceholders(object, {},rawData.data)
|
||||||
this.feedItem = object
|
this.feedItem = object
|
||||||
this.status = response.data
|
this.status = response.data
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const intervalId = setInterval(async () => {
|
const intervalId = setInterval(async () => {
|
||||||
if (isCalling) return
|
if (isCalling) return
|
||||||
isCalling = true
|
isCalling = true
|
||||||
|
|
||||||
const data = await requestQueue.enqueue(() => {
|
const data = await requestQueue.enqueue(() => {
|
||||||
return axios.get(`${this.nodeUrl}/arbitrary/resource/status/${this.resource.service}/${this.resource.name}/${this.resource.identifier}?apiKey=${this.myNode.apiKey}`)
|
return axios.get(`${this.nodeUrl}/arbitrary/resource/status/${this.resource.service}/${this.resource.name}/${this.resource.identifier}?apiKey=${this.myNode.apiKey}`)
|
||||||
});
|
});
|
||||||
@ -302,7 +299,7 @@ getMyNode(){
|
|||||||
...res,
|
...res,
|
||||||
status: 'REFETCHING'
|
status: 'REFETCHING'
|
||||||
}
|
}
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
isCalling = false
|
isCalling = false
|
||||||
this.fetchResource()
|
this.fetchResource()
|
||||||
@ -311,7 +308,7 @@ getMyNode(){
|
|||||||
}
|
}
|
||||||
percentLoaded = res.percentLoaded
|
percentLoaded = res.percentLoaded
|
||||||
}
|
}
|
||||||
|
|
||||||
this.status = res
|
this.status = res
|
||||||
if(this.status.status === 'DOWNLOADED'){
|
if(this.status.status === 'DOWNLOADED'){
|
||||||
this.fetchResource()
|
this.fetchResource()
|
||||||
@ -345,7 +342,7 @@ getMyNode(){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
async goToFeedLink(){
|
async goToFeedLink(){
|
||||||
try {
|
try {
|
||||||
@ -386,7 +383,7 @@ getMyNode(){
|
|||||||
console.log({error})
|
console.log({error})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
async extractComponents(url) {
|
async extractComponents(url) {
|
||||||
@ -434,11 +431,11 @@ getMyNode(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
let avatarImg
|
let avatarImg
|
||||||
@ -469,7 +466,7 @@ getMyNode(){
|
|||||||
style=" box-sizing: border-box;"
|
style=" box-sizing: border-box;"
|
||||||
>
|
>
|
||||||
${
|
${
|
||||||
this.status.status !== 'READY'
|
this.status.status !== 'READY'
|
||||||
? html`
|
? html`
|
||||||
<div
|
<div
|
||||||
style="display:flex;flex-direction:column;width:100%;height:100%;justify-content:center;align-items:center; box-sizing: border-box;"
|
style="display:flex;flex-direction:column;width:100%;height:100%;justify-content:center;align-items:center; box-sizing: border-box;"
|
||||||
@ -506,10 +503,10 @@ getMyNode(){
|
|||||||
` : ''}
|
` : ''}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
// popover-component.js
|
// popover-component.js
|
||||||
import { LitElement, html, css } 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 { use, get, translate } from 'lit-translate';
|
import {translate} from 'lit-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';
|
||||||
import ShortUniqueId from 'short-unique-id';
|
import ShortUniqueId from 'short-unique-id';
|
||||||
|
|
||||||
export class FriendItemActions extends connect(store)(LitElement) {
|
export class FriendItemActions extends connect(store)(LitElement) {
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import { LitElement, html, css } from 'lit';
|
import {html, LitElement} from 'lit';
|
||||||
import '@material/mwc-icon';
|
import '@material/mwc-icon';
|
||||||
import './friends-view'
|
import './friends-view'
|
||||||
import { friendsViewStyles } from './friends-view-css';
|
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 'lit-translate';
|
import {translate} from 'lit-translate';
|
||||||
|
|
||||||
import '@polymer/paper-spinner/paper-spinner-lite.js'
|
import '@polymer/paper-spinner/paper-spinner-lite.js'
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ class FriendsFeed extends connect(store)(LitElement) {
|
|||||||
this.myNode = this.getMyNode();
|
this.myNode = this.getMyNode();
|
||||||
this.endpoints = []
|
this.endpoints = []
|
||||||
this.endpointOffsets = [] // Initialize offsets for each endpoint to 0
|
this.endpointOffsets = [] // Initialize offsets for each endpoint to 0
|
||||||
|
|
||||||
this.loadAndMergeData = this.loadAndMergeData.bind(this)
|
this.loadAndMergeData = this.loadAndMergeData.bind(this)
|
||||||
this.hasInitialFetch = false
|
this.hasInitialFetch = false
|
||||||
this.observerHandler = this.observerHandler.bind(this);
|
this.observerHandler = this.observerHandler.bind(this);
|
||||||
@ -42,12 +42,12 @@ class FriendsFeed extends connect(store)(LitElement) {
|
|||||||
this._updateFeeds = this._updateFeeds.bind(this)
|
this._updateFeeds = this._updateFeeds.bind(this)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles() {
|
static get styles() {
|
||||||
return [friendsViewStyles];
|
return [friendsViewStyles];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
getNodeUrl() {
|
getNodeUrl() {
|
||||||
const myNode =
|
const myNode =
|
||||||
@ -109,7 +109,7 @@ class FriendsFeed extends connect(store)(LitElement) {
|
|||||||
let interval = null;
|
let interval = null;
|
||||||
let stop = false;
|
let stop = false;
|
||||||
const getAnswer = async () => {
|
const getAnswer = async () => {
|
||||||
|
|
||||||
if (!stop) {
|
if (!stop) {
|
||||||
stop = true;
|
stop = true;
|
||||||
try {
|
try {
|
||||||
@ -119,19 +119,19 @@ class FriendsFeed extends connect(store)(LitElement) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
interval = setInterval(getAnswer, 900000);
|
interval = setInterval(getAnswer, 900000);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async getEndpoints(){
|
async getEndpoints(){
|
||||||
const dynamicVars = {
|
const dynamicVars = {
|
||||||
|
|
||||||
}
|
}
|
||||||
const schemas = await this.getSchemas()
|
const schemas = await this.getSchemas()
|
||||||
const friendList = JSON.parse(localStorage.getItem('friends-my-friend-list') || "[]")
|
const friendList = JSON.parse(localStorage.getItem('friends-my-friend-list') || "[]")
|
||||||
const names = friendList.map(friend => `name=${friend.name}`).join('&');
|
const names = friendList.map(friend => `name=${friend.name}`).join('&');
|
||||||
if(names.length === 0){
|
if(names.length === 0){
|
||||||
this.endpoints= []
|
this.endpoints= []
|
||||||
this.endpointOffsets = Array(this.endpoints.length).fill(0);
|
this.endpointOffsets = Array(this.endpoints.length).fill(0);
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const baseurl = `${this.nodeUrl}/arbitrary/resources/search?reverse=true&exactmatchnames=true&${names}`
|
const baseurl = `${this.nodeUrl}/arbitrary/resources/search?reverse=true&exactmatchnames=true&${names}`
|
||||||
@ -147,11 +147,11 @@ class FriendsFeed extends connect(store)(LitElement) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
this.endpoints= formEndpoints
|
this.endpoints= formEndpoints
|
||||||
this.endpointOffsets = Array(this.endpoints.length).fill(0);
|
this.endpointOffsets = Array(this.endpoints.length).fill(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
async firstUpdated(){
|
async firstUpdated(){
|
||||||
@ -159,8 +159,8 @@ class FriendsFeed extends connect(store)(LitElement) {
|
|||||||
this.downObserverElement =
|
this.downObserverElement =
|
||||||
this.shadowRoot.getElementById('downObserver');
|
this.shadowRoot.getElementById('downObserver');
|
||||||
this.elementObserver();
|
this.elementObserver();
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await new Promise((res)=> {
|
await new Promise((res)=> {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@ -172,7 +172,7 @@ class FriendsFeed extends connect(store)(LitElement) {
|
|||||||
|
|
||||||
this.loadAndMergeData();
|
this.loadAndMergeData();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.getFeedOnInterval()
|
this.getFeedOnInterval()
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -192,7 +192,7 @@ this.getFeedOnInterval()
|
|||||||
await this.getEndpoints()
|
await this.getEndpoints()
|
||||||
this.reFetchFeedData()
|
this.reFetchFeedData()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -236,17 +236,17 @@ this.getFeedOnInterval()
|
|||||||
...i
|
...i
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async initialLoad() {
|
async initialLoad() {
|
||||||
let results = [];
|
let results = [];
|
||||||
let totalFetched = 0;
|
let totalFetched = 0;
|
||||||
let i = 0;
|
let i = 0;
|
||||||
let madeProgress = true;
|
let madeProgress = true;
|
||||||
let exhaustedEndpoints = new Set();
|
let exhaustedEndpoints = new Set();
|
||||||
|
|
||||||
while (totalFetched < totalDesiredCount && madeProgress) {
|
while (totalFetched < totalDesiredCount && madeProgress) {
|
||||||
madeProgress = false;
|
madeProgress = false;
|
||||||
this.isLoading = true
|
this.isLoading = true
|
||||||
@ -254,32 +254,32 @@ this.getFeedOnInterval()
|
|||||||
if (exhaustedEndpoints.has(i)) {
|
if (exhaustedEndpoints.has(i)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const remainingCount = totalDesiredCount - totalFetched;
|
const remainingCount = totalDesiredCount - totalFetched;
|
||||||
|
|
||||||
// If we've already reached the desired count, break
|
// If we've already reached the desired count, break
|
||||||
if (remainingCount <= 0) {
|
if (remainingCount <= 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
let fetchCount = Math.min(perEndpointCount, remainingCount);
|
let fetchCount = Math.min(perEndpointCount, remainingCount);
|
||||||
let data = await this.fetchDataFromEndpoint(i, fetchCount);
|
let data = await this.fetchDataFromEndpoint(i, fetchCount);
|
||||||
|
|
||||||
// Increment the offset for this endpoint by the number of items fetched
|
// Increment the offset for this endpoint by the number of items fetched
|
||||||
this.endpointOffsets[i] += data.length;
|
this.endpointOffsets[i] += data.length;
|
||||||
|
|
||||||
if (data.length > 0) {
|
if (data.length > 0) {
|
||||||
madeProgress = true;
|
madeProgress = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.length < fetchCount) {
|
if (data.length < fetchCount) {
|
||||||
exhaustedEndpoints.add(i);
|
exhaustedEndpoints.add(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
results = results.concat(data);
|
results = results.concat(data);
|
||||||
totalFetched += data.length;
|
totalFetched += data.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exhaustedEndpoints.size === this.endpoints.length) {
|
if (exhaustedEndpoints.size === this.endpoints.length) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -289,15 +289,15 @@ this.getFeedOnInterval()
|
|||||||
// Trim the results if somehow they are over the totalDesiredCount
|
// Trim the results if somehow they are over the totalDesiredCount
|
||||||
return results.slice(0, totalDesiredCount);
|
return results.slice(0, totalDesiredCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
trimDataToLimit(data, limit) {
|
trimDataToLimit(data, limit) {
|
||||||
return data.slice(0, limit);
|
return data.slice(0, limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
mergeData(newData, existingData) {
|
mergeData(newData, existingData) {
|
||||||
const existingIds = new Set(existingData.map(item => item.identifier)); // Assume each item has a unique 'id'
|
const existingIds = new Set(existingData.map(item => item.identifier)); // Assume each item has a unique 'id'
|
||||||
const uniqueNewData = newData.filter(item => !existingIds.has(item.identifier));
|
const uniqueNewData = newData.filter(item => !existingIds.has(item.identifier));
|
||||||
@ -325,37 +325,37 @@ this.getFeedOnInterval()
|
|||||||
const resource = newItem
|
const resource = newItem
|
||||||
|
|
||||||
let clickValue1 = newItem.schema.click;
|
let clickValue1 = newItem.schema.click;
|
||||||
|
|
||||||
const resolvedClickValue1 = replacePlaceholders(clickValue1, resource, newItem.schema.customParams);
|
const resolvedClickValue1 = replacePlaceholders(clickValue1, resource, newItem.schema.customParams);
|
||||||
newItem.link = resolvedClickValue1
|
newItem.link = resolvedClickValue1
|
||||||
newData.push(newItem)
|
newData.push(newItem)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return newData
|
return newData
|
||||||
|
|
||||||
}
|
}
|
||||||
async reFetchFeedData() {
|
async reFetchFeedData() {
|
||||||
// Resetting offsets to start fresh.
|
// Resetting offsets to start fresh.
|
||||||
this.endpointOffsets = Array(this.endpoints.length).fill(0);
|
this.endpointOffsets = Array(this.endpoints.length).fill(0);
|
||||||
await this.getEndpoints()
|
await this.getEndpoints()
|
||||||
const oldIdentifiers = new Set(this.feed.map(item => item.identifier));
|
const oldIdentifiers = new Set(this.feed.map(item => item.identifier));
|
||||||
const newData = await this.initialLoad();
|
const newData = await this.initialLoad();
|
||||||
|
|
||||||
// Filter out items that are already in the feed
|
// Filter out items that are already in the feed
|
||||||
const trulyNewData = newData.filter(item => !oldIdentifiers.has(item.identifier));
|
const trulyNewData = newData.filter(item => !oldIdentifiers.has(item.identifier));
|
||||||
|
|
||||||
if (trulyNewData.length > 0) {
|
if (trulyNewData.length > 0) {
|
||||||
// Adding extra data and merging with old data
|
// Adding extra data and merging with old data
|
||||||
const enhancedNewData = await this.addExtraData(trulyNewData);
|
const enhancedNewData = await this.addExtraData(trulyNewData);
|
||||||
|
|
||||||
// Merge new data with old data immutably
|
// Merge new data with old data immutably
|
||||||
this.feed = [...enhancedNewData, ...this.feed];
|
this.feed = [...enhancedNewData, ...this.feed];
|
||||||
|
|
||||||
this.feed.sort((a, b) => new Date(b.created) - new Date(a.created)); // Sort by timestamp, most recent first
|
this.feed.sort((a, b) => new Date(b.created) - new Date(a.created)); // Sort by timestamp, most recent first
|
||||||
this.feed = this.trimDataToLimit(this.feed, maxResultsInMemory); // Trim to the maximum allowed in memory
|
this.feed = this.trimDataToLimit(this.feed, maxResultsInMemory); // Trim to the maximum allowed in memory
|
||||||
this.feedToRender = this.feed.slice(0, 20);
|
this.feedToRender = this.feed.slice(0, 20);
|
||||||
this.hasInitialFetch = true;
|
this.hasInitialFetch = true;
|
||||||
|
|
||||||
const created = trulyNewData[0].created;
|
const created = trulyNewData[0].created;
|
||||||
let value = localStorage.getItem('lastSeenFeed');
|
let value = localStorage.getItem('lastSeenFeed');
|
||||||
if (((+value || 0) < created)) {
|
if (((+value || 0) < created)) {
|
||||||
@ -363,9 +363,9 @@ this.getFeedOnInterval()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
async loadAndMergeData() {
|
async loadAndMergeData() {
|
||||||
let allData = this.feed
|
let allData = this.feed
|
||||||
const newData = await this.initialLoad();
|
const newData = await this.initialLoad();
|
||||||
@ -387,7 +387,7 @@ this.getFeedOnInterval()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return html`
|
return html`
|
||||||
@ -450,7 +450,7 @@ export function constructUrl(base, search, dynamicVars) {
|
|||||||
|
|
||||||
export function replacePlaceholders(template, resource, customParams) {
|
export function replacePlaceholders(template, resource, customParams) {
|
||||||
const dataSource = { resource, customParams };
|
const dataSource = { resource, customParams };
|
||||||
|
|
||||||
return template.replace(/\$\$\{(.*?)\}\$\$/g, (match, p1) => {
|
return template.replace(/\$\$\{(.*?)\}\$\$/g, (match, p1) => {
|
||||||
const keys = p1.split('.');
|
const keys = p1.split('.');
|
||||||
let value = dataSource;
|
let value = dataSource;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { LitElement, html, css } from 'lit';
|
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 'lit-translate';
|
import {translate} from 'lit-translate';
|
||||||
|
|
||||||
|
|
||||||
class FriendsSidePanelParent extends LitElement {
|
class FriendsSidePanelParent extends LitElement {
|
||||||
@ -12,7 +12,7 @@ class FriendsSidePanelParent extends LitElement {
|
|||||||
hasNewFeed: {type: Boolean}
|
hasNewFeed: {type: Boolean}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
@ -71,7 +71,7 @@ class FriendsSidePanelParent extends LitElement {
|
|||||||
text=${translate('friends.friend12')}>
|
text=${translate('friends.friend12')}>
|
||||||
</vaadin-tooltip>
|
</vaadin-tooltip>
|
||||||
<friends-side-panel .setHasNewFeed=${(val)=> this.setHasNewFeed(val)} ?isOpen=${this.isOpen} .setIsOpen=${(val)=> this.isOpen = val}></friends-side-panel>
|
<friends-side-panel .setHasNewFeed=${(val)=> this.setHasNewFeed(val)} ?isOpen=${this.isOpen} .setIsOpen=${(val)=> this.isOpen = val}></friends-side-panel>
|
||||||
|
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import { LitElement, html, css } from 'lit';
|
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 'lit-translate';
|
import {translate} from 'lit-translate';
|
||||||
|
|
||||||
class FriendsSidePanel extends LitElement {
|
class FriendsSidePanel extends LitElement {
|
||||||
static get properties() {
|
static get properties() {
|
||||||
return {
|
return {
|
||||||
@ -19,7 +20,7 @@ class FriendsSidePanel extends LitElement {
|
|||||||
this.selected = 'friends'
|
this.selected = 'friends'
|
||||||
this.closeSidePanel = this.closeSidePanel.bind(this)
|
this.closeSidePanel = this.closeSidePanel.bind(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
static styles = css`
|
static styles = css`
|
||||||
:host {
|
:host {
|
||||||
display: block;
|
display: block;
|
||||||
@ -98,14 +99,14 @@ class FriendsSidePanel extends LitElement {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: -50;
|
z-index: -50;
|
||||||
}
|
}
|
||||||
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
refreshFeed(){
|
refreshFeed(){
|
||||||
|
|
||||||
this.shadowRoot.querySelector('friends-feed').refresh()
|
this.shadowRoot.querySelector('friends-feed').refresh()
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
closeSidePanel(){
|
closeSidePanel(){
|
||||||
@ -128,7 +129,7 @@ class FriendsSidePanel extends LitElement {
|
|||||||
this.setIsOpen(false)
|
this.setIsOpen(false)
|
||||||
}}>close</mwc-icon>
|
}}>close</mwc-icon>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="${this.selected === 'friends' ? 'active-content' : 'default-content'}">
|
<div class="${this.selected === 'friends' ? 'active-content' : 'default-content'}">
|
||||||
@ -137,8 +138,8 @@ class FriendsSidePanel extends LitElement {
|
|||||||
<div class="${this.selected === 'feed' ? 'active-content' : 'default-content'}">
|
<div class="${this.selected === 'feed' ? 'active-content' : 'default-content'}">
|
||||||
<friends-feed .setHasNewFeed=${(val)=> this.setHasNewFeed(val)}></friends-feed>
|
<friends-feed .setHasNewFeed=${(val)=> this.setHasNewFeed(val)}></friends-feed>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { css } from 'lit'
|
import {css} from 'lit'
|
||||||
|
|
||||||
export const friendsViewStyles = css`
|
export const friendsViewStyles = css`
|
||||||
* {
|
* {
|
||||||
@ -37,9 +37,9 @@ export const friendsViewStyles = css`
|
|||||||
|
|
||||||
.container-body {
|
.container-body {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
padding: 0px 6px;
|
padding: 0px 6px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
@ -51,13 +51,13 @@ export const friendsViewStyles = css`
|
|||||||
background-color: whitesmoke;
|
background-color: whitesmoke;
|
||||||
border-radius: 7px;
|
border-radius: 7px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.container-body::-webkit-scrollbar {
|
.container-body::-webkit-scrollbar {
|
||||||
width: 6px;
|
width: 6px;
|
||||||
border-radius: 7px;
|
border-radius: 7px;
|
||||||
background-color: whitesmoke;
|
background-color: whitesmoke;
|
||||||
}
|
}
|
||||||
|
|
||||||
.container-body::-webkit-scrollbar-thumb {
|
.container-body::-webkit-scrollbar-thumb {
|
||||||
background-color: rgb(180, 176, 176);
|
background-color: rgb(180, 176, 176);
|
||||||
border-radius: 7px;
|
border-radius: 7px;
|
||||||
@ -67,7 +67,7 @@ export const friendsViewStyles = css`
|
|||||||
.container-body::-webkit-scrollbar-thumb:hover {
|
.container-body::-webkit-scrollbar-thumb:hover {
|
||||||
background-color: rgb(148, 146, 146);
|
background-color: rgb(148, 146, 146);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
p {
|
p {
|
||||||
color: var(--black);
|
color: var(--black);
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { LitElement, html, css } from 'lit';
|
import {html, LitElement} from 'lit';
|
||||||
import { render } from 'lit/html.js';
|
import {connect} from 'pwa-helpers';
|
||||||
import { connect } from 'pwa-helpers';
|
|
||||||
|
|
||||||
import '@material/mwc-button';
|
import '@material/mwc-button';
|
||||||
import '@material/mwc-dialog';
|
import '@material/mwc-dialog';
|
||||||
@ -14,16 +13,10 @@ import './ChatSideNavHeads';
|
|||||||
import '../../../../plugins/plugins/core/components/ChatSearchResults'
|
import '../../../../plugins/plugins/core/components/ChatSearchResults'
|
||||||
import './add-friends-modal'
|
import './add-friends-modal'
|
||||||
|
|
||||||
import {
|
import {translate,} from 'lit-translate';
|
||||||
use,
|
import {store} from '../../store';
|
||||||
get,
|
import {friendsViewStyles} from './friends-view-css';
|
||||||
translate,
|
import {parentEpml} from '../show-plugin';
|
||||||
translateUnsafeHTML,
|
|
||||||
registerTranslateConfig,
|
|
||||||
} from 'lit-translate';
|
|
||||||
import { store } from '../../store';
|
|
||||||
import { friendsViewStyles } from './friends-view-css';
|
|
||||||
import { parentEpml } from '../show-plugin';
|
|
||||||
|
|
||||||
class FriendsView extends connect(store)(LitElement) {
|
class FriendsView extends connect(store)(LitElement) {
|
||||||
static get properties() {
|
static get properties() {
|
||||||
@ -103,10 +96,10 @@ class FriendsView extends connect(store)(LitElement) {
|
|||||||
this.elementObserver();
|
this.elementObserver();
|
||||||
this.mySelectedFeeds = JSON.parse(localStorage.getItem('friends-my-selected-feeds') || "[]")
|
this.mySelectedFeeds = JSON.parse(localStorage.getItem('friends-my-selected-feeds') || "[]")
|
||||||
this.friendList = JSON.parse(localStorage.getItem('friends-my-friend-list') || "[]")
|
this.friendList = JSON.parse(localStorage.getItem('friends-my-friend-list') || "[]")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_updateFriends(event) {
|
_updateFriends(event) {
|
||||||
@ -121,13 +114,13 @@ class FriendsView extends connect(store)(LitElement) {
|
|||||||
|
|
||||||
connectedCallback() {
|
connectedCallback() {
|
||||||
super.connectedCallback()
|
super.connectedCallback()
|
||||||
window.addEventListener('friends-my-friend-list-event', this._updateFriends)
|
window.addEventListener('friends-my-friend-list-event', this._updateFriends)
|
||||||
window.addEventListener('friends-my-selected-feeds-event', this._updateFeed)
|
window.addEventListener('friends-my-selected-feeds-event', this._updateFeed)
|
||||||
}
|
}
|
||||||
|
|
||||||
disconnectedCallback() {
|
disconnectedCallback() {
|
||||||
window.removeEventListener('friends-my-friend-list-event', this._updateFriends)
|
window.removeEventListener('friends-my-friend-list-event', this._updateFriends)
|
||||||
window.addEventListener('friends-my-selected-feeds-event', this._updateFeed)
|
window.addEventListener('friends-my-selected-feeds-event', this._updateFeed)
|
||||||
super.disconnectedCallback()
|
super.disconnectedCallback()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,7 +162,7 @@ class FriendsView extends connect(store)(LitElement) {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const url = `${this.nodeUrl}/names/${nameValue}`
|
const url = `${this.nodeUrl}/names/${nameValue}`
|
||||||
const res = await fetch(url)
|
const res = await fetch(url)
|
||||||
const result = await res.json()
|
const result = await res.json()
|
||||||
if (result.error === 401) {
|
if (result.error === 401) {
|
||||||
this.userFound = []
|
this.userFound = []
|
||||||
@ -179,7 +172,7 @@ class FriendsView extends connect(store)(LitElement) {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
this.userFoundModalOpen = true;
|
this.userFoundModalOpen = true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// let err4string = get("chatpage.cchange35");
|
// let err4string = get("chatpage.cchange35");
|
||||||
// parentEpml.request('showSnackBar', `${err4string}`)
|
// parentEpml.request('showSnackBar', `${err4string}`)
|
||||||
}
|
}
|
||||||
@ -196,7 +189,7 @@ class FriendsView extends connect(store)(LitElement) {
|
|||||||
name
|
name
|
||||||
]
|
]
|
||||||
let namesJsonString = JSON.stringify({ "items": items })
|
let namesJsonString = JSON.stringify({ "items": items })
|
||||||
|
|
||||||
let ret = await parentEpml.request('apiCall', {
|
let ret = await parentEpml.request('apiCall', {
|
||||||
url: `/lists/followedNames?apiKey=${this.getApiKey()}`,
|
url: `/lists/followedNames?apiKey=${this.getApiKey()}`,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@ -205,8 +198,8 @@ class FriendsView extends connect(store)(LitElement) {
|
|||||||
},
|
},
|
||||||
body: `${namesJsonString}`
|
body: `${namesJsonString}`
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -215,7 +208,7 @@ class FriendsView extends connect(store)(LitElement) {
|
|||||||
name
|
name
|
||||||
]
|
]
|
||||||
let namesJsonString = JSON.stringify({ "items": items })
|
let namesJsonString = JSON.stringify({ "items": items })
|
||||||
|
|
||||||
let ret = await parentEpml.request('apiCall', {
|
let ret = await parentEpml.request('apiCall', {
|
||||||
url: `/lists/followedNames?apiKey=${this.getApiKey()}`,
|
url: `/lists/followedNames?apiKey=${this.getApiKey()}`,
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
@ -224,8 +217,8 @@ class FriendsView extends connect(store)(LitElement) {
|
|||||||
},
|
},
|
||||||
body: `${namesJsonString}`
|
body: `${namesJsonString}`
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
async addToFriendList(val, isRemove){
|
async addToFriendList(val, isRemove){
|
||||||
@ -239,9 +232,9 @@ class FriendsView extends connect(store)(LitElement) {
|
|||||||
const copyList = [...this.friendList]
|
const copyList = [...this.friendList]
|
||||||
copyList[findFriend] = copyVal
|
copyList[findFriend] = copyVal
|
||||||
this.friendList = copyList
|
this.friendList = copyList
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.friendList = [...this.friendList, copyVal]
|
this.friendList = [...this.friendList, copyVal]
|
||||||
}
|
}
|
||||||
@ -249,7 +242,7 @@ class FriendsView extends connect(store)(LitElement) {
|
|||||||
this.unFollowName(copyVal.name)
|
this.unFollowName(copyVal.name)
|
||||||
} else if(copyVal.willFollow){
|
} else if(copyVal.willFollow){
|
||||||
this.myFollowName(copyVal.name)
|
this.myFollowName(copyVal.name)
|
||||||
}
|
}
|
||||||
this.setMySelectedFeeds(val.mySelectedFeeds)
|
this.setMySelectedFeeds(val.mySelectedFeeds)
|
||||||
await new Promise((res)=> {
|
await new Promise((res)=> {
|
||||||
setTimeout(()=> {
|
setTimeout(()=> {
|
||||||
@ -319,12 +312,12 @@ class FriendsView extends connect(store)(LitElement) {
|
|||||||
<div id="viewElement" class="container-body" style=${"position: relative"}>
|
<div id="viewElement" class="container-body" style=${"position: relative"}>
|
||||||
<p class="group-name">My Friends</p>
|
<p class="group-name">My Friends</p>
|
||||||
<div class="search-field">
|
<div class="search-field">
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
class="name-input"
|
class="name-input"
|
||||||
?disabled=${this.isLoading}
|
?disabled=${this.isLoading}
|
||||||
id="sendTo"
|
id="sendTo"
|
||||||
placeholder="${translate("friends.friend1")}"
|
placeholder="${translate("friends.friend1")}"
|
||||||
value=${this.userSelected.name ? this.userSelected.name: ''}
|
value=${this.userSelected.name ? this.userSelected.name: ''}
|
||||||
@keypress=${(e) => {
|
@keypress=${(e) => {
|
||||||
if(e.key === 'Enter'){
|
if(e.key === 'Enter'){
|
||||||
@ -332,21 +325,21 @@ class FriendsView extends connect(store)(LitElement) {
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<vaadin-icon
|
<vaadin-icon
|
||||||
@click=${this.userSearch}
|
@click=${this.userSearch}
|
||||||
slot="icon"
|
slot="icon"
|
||||||
icon="vaadin:search"
|
icon="vaadin:search"
|
||||||
class="search-icon">
|
class="search-icon">
|
||||||
</vaadin-icon>
|
</vaadin-icon>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="search-results-div">
|
<div class="search-results-div">
|
||||||
<chat-search-results
|
<chat-search-results
|
||||||
.onClickFunc=${(result) => {
|
.onClickFunc=${(result) => {
|
||||||
this.userSelected = result;
|
this.userSelected = result;
|
||||||
this.isOpenAddFriendsModal = true
|
this.isOpenAddFriendsModal = true
|
||||||
|
|
||||||
this.userFound = [];
|
this.userFound = [];
|
||||||
this.userFoundModalOpen = false;
|
this.userFoundModalOpen = false;
|
||||||
}}
|
}}
|
||||||
@ -359,13 +352,13 @@ class FriendsView extends connect(store)(LitElement) {
|
|||||||
?loading=${this.isLoading}>
|
?loading=${this.isLoading}>
|
||||||
</chat-search-results>
|
</chat-search-results>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
${this.friendList.map((item) => {
|
${this.friendList.map((item) => {
|
||||||
return html`<chat-side-nav-heads
|
return html`<chat-side-nav-heads
|
||||||
activeChatHeadUrl=""
|
activeChatHeadUrl=""
|
||||||
.setActiveChatHeadUrl=${(val) => {
|
.setActiveChatHeadUrl=${(val) => {
|
||||||
|
|
||||||
}}
|
}}
|
||||||
.chatInfo=${item}
|
.chatInfo=${item}
|
||||||
.openEditFriend=${(val)=> this.openEditFriend(val)}
|
.openEditFriend=${(val)=> this.openEditFriend(val)}
|
||||||
@ -376,7 +369,7 @@ class FriendsView extends connect(store)(LitElement) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<add-friends-modal
|
<add-friends-modal
|
||||||
?isOpen=${this.isOpenAddFriendsModal}
|
?isOpen=${this.isOpenAddFriendsModal}
|
||||||
.setIsOpen=${(val)=> {
|
.setIsOpen=${(val)=> {
|
||||||
this.isOpenAddFriendsModal = val
|
this.isOpenAddFriendsModal = val
|
||||||
}}
|
}}
|
||||||
|
@ -1,21 +1,20 @@
|
|||||||
import { LitElement, html, css } from 'lit';
|
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 { connect } from 'pwa-helpers';
|
import {connect} from 'pwa-helpers';
|
||||||
import { store } from '../../store.js';
|
import {store} from '../../store.js';
|
||||||
import WebWorker from 'web-worker:./computePowWorkerFile.src.js';
|
import WebWorker from 'web-worker:./computePowWorkerFile.src.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 'lit-translate';
|
import {translate} from 'lit-translate';
|
||||||
import {
|
import {
|
||||||
decryptGroupData,
|
decryptGroupData,
|
||||||
encryptDataGroup,
|
encryptDataGroup,
|
||||||
objectToBase64,
|
objectToBase64,
|
||||||
uint8ArrayToBase64,
|
|
||||||
uint8ArrayToObject,
|
uint8ArrayToObject,
|
||||||
} from '../../../../plugins/plugins/core/components/qdn-action-encryption.js';
|
} from '../../../../plugins/plugins/core/components/qdn-action-encryption.js';
|
||||||
import { publishData } from '../../../../plugins/plugins/utils/publish-image.js';
|
import {publishData} from '../../../../plugins/plugins/utils/publish-image.js';
|
||||||
import { parentEpml } from '../show-plugin.js';
|
import {parentEpml} from '../show-plugin.js';
|
||||||
import '../notification-view/popover.js';
|
import '../notification-view/popover.js';
|
||||||
|
|
||||||
class SaveSettingsQdn extends connect(store)(LitElement) {
|
class SaveSettingsQdn extends connect(store)(LitElement) {
|
||||||
@ -159,14 +158,14 @@ class SaveSettingsQdn extends connect(store)(LitElement) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getMyFollowedNames() {
|
async getMyFollowedNames() {
|
||||||
|
|
||||||
let myFollowedNames = []
|
let myFollowedNames = []
|
||||||
try {
|
try {
|
||||||
myFollowedNames = await parentEpml.request('apiCall', {
|
myFollowedNames = await parentEpml.request('apiCall', {
|
||||||
url: `/lists/followedNames?apiKey=${this.myNode.apiKey}`
|
url: `/lists/followedNames?apiKey=${this.myNode.apiKey}`
|
||||||
})
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return myFollowedNames
|
return myFollowedNames
|
||||||
@ -185,7 +184,7 @@ class SaveSettingsQdn extends connect(store)(LitElement) {
|
|||||||
body: `${namesJsonString}`
|
body: `${namesJsonString}`
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { LitElement, html, css } from 'lit'
|
import {css, html, LitElement} from 'lit'
|
||||||
import { use, translate, translateUnsafeHTML, registerTranslateConfig } from 'lit-translate'
|
import {registerTranslateConfig, translate, use} from 'lit-translate'
|
||||||
|
|
||||||
registerTranslateConfig({
|
registerTranslateConfig({
|
||||||
loader: lang => fetch(`/language/${lang}.json`).then(res => res.json())
|
loader: lang => fetch(`/language/${lang}.json`).then(res => res.json())
|
||||||
@ -56,7 +56,7 @@ class LanguageSelector extends LitElement {
|
|||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
select option {
|
select option {
|
||||||
color: var(--black);
|
color: var(--black);
|
||||||
background: var(--white);
|
background: var(--white);
|
||||||
line-height: 34px;
|
line-height: 34px;
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import { LitElement, html, css } 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 { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from 'lit-translate'
|
import {get, translate} from 'lit-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'
|
||||||
import { doStoreWallet } from '../../redux/user/user-actions.js'
|
import {doStoreWallet} from '../../redux/user/user-actions.js'
|
||||||
import { checkApiKey } from '../../apiKeyUtils.js'
|
import {checkApiKey} from '../../apiKeyUtils.js'
|
||||||
import FileSaver from 'file-saver'
|
import FileSaver from 'file-saver'
|
||||||
import ripple from '../../functional-components/loading-ripple.js'
|
import ripple from '../../functional-components/loading-ripple.js'
|
||||||
import snackbar from '../../functional-components/snackbar.js'
|
import snackbar from '../../functional-components/snackbar.js'
|
||||||
@ -252,7 +252,7 @@ class CreateAccountSection extends connect(store)(LitElement) {
|
|||||||
return html`
|
return html`
|
||||||
<style>
|
<style>
|
||||||
div[hidden] {
|
div[hidden] {
|
||||||
display:none !important;
|
display:none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.flex {
|
.flex {
|
||||||
@ -360,7 +360,7 @@ class CreateAccountSection extends connect(store)(LitElement) {
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div id="createAccountSection" class="flex column">
|
<div id="createAccountSection" class="flex column">
|
||||||
<iron-pages selected="${this.selectedPage}" attr-for-selected="page" id="createAccountPages">
|
<iron-pages selected="${this.selectedPage}" attr-for-selected="page" id="createAccountPages">
|
||||||
<div page="info">
|
<div page="info">
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { LitElement, html, css } 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 { checkApiKey } from '../../apiKeyUtils.js'
|
import {checkApiKey} from '../../apiKeyUtils.js'
|
||||||
import { translate, translateUnsafeHTML } from 'lit-translate'
|
import {translate} from 'lit-translate'
|
||||||
|
|
||||||
import '@material/mwc-button'
|
import '@material/mwc-button'
|
||||||
import '@material/mwc-checkbox'
|
import '@material/mwc-checkbox'
|
||||||
@ -18,9 +18,9 @@ import '@polymer/iron-collapse'
|
|||||||
import '@polymer/paper-spinner/paper-spinner-lite.js'
|
import '@polymer/paper-spinner/paper-spinner-lite.js'
|
||||||
import '@vaadin/text-field/vaadin-text-field.js'
|
import '@vaadin/text-field/vaadin-text-field.js'
|
||||||
import '@vaadin/password-field/vaadin-password-field.js'
|
import '@vaadin/password-field/vaadin-password-field.js'
|
||||||
import { doLogin, doSelectAddress } from '../../redux/app/app-actions.js'
|
import {doLogin, doSelectAddress} from '../../redux/app/app-actions.js'
|
||||||
import { doStoreWallet, doRemoveWallet } from '../../redux/user/user-actions.js'
|
import {doRemoveWallet, doStoreWallet} from '../../redux/user/user-actions.js'
|
||||||
import { createWallet } from '../../../../crypto/api/createWallet.js'
|
import {createWallet} from '../../../../crypto/api/createWallet.js'
|
||||||
import snackbar from '../../functional-components/snackbar.js'
|
import snackbar from '../../functional-components/snackbar.js'
|
||||||
import '../../custom-elements/frag-file-input.js'
|
import '../../custom-elements/frag-file-input.js'
|
||||||
import ripple from '../../functional-components/loading-ripple.js'
|
import ripple from '../../functional-components/loading-ripple.js'
|
||||||
@ -195,7 +195,7 @@ class LoginSection extends connect(store)(LitElement) {
|
|||||||
right: 5px;
|
right: 5px;
|
||||||
top: 20px;
|
top: 20px;
|
||||||
color: tomato;
|
color: tomato;
|
||||||
--mdc-icon-size: 30px;
|
--mdc-icon-size: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-option {
|
.login-option {
|
||||||
@ -212,7 +212,7 @@ class LoginSection extends connect(store)(LitElement) {
|
|||||||
color: var(--black);
|
color: var(--black);
|
||||||
}
|
}
|
||||||
|
|
||||||
*[hidden] {
|
*[hidden] {
|
||||||
display:none !important;
|
display:none !important;
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
@ -268,7 +268,7 @@ class LoginSection extends connect(store)(LitElement) {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div id="loginSection">
|
<div id="loginSection">
|
||||||
<div id="pagesContainer">
|
<div id="pagesContainer">
|
||||||
<iron-pages style="padding: 0;" selected="${this.selectedPage}" attr-for-selected="page" id="loginPages">
|
<iron-pages style="padding: 0;" selected="${this.selectedPage}" attr-for-selected="page" id="loginPages">
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { LitElement, html, css } 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 { stateAwait } from '../../stateAwait.js'
|
import {stateAwait} from '../../stateAwait.js'
|
||||||
import { translate, get, translateUnsafeHTML } from 'lit-translate'
|
import {get} from 'lit-translate'
|
||||||
|
|
||||||
import '@material/mwc-button'
|
import '@material/mwc-button'
|
||||||
import '@material/mwc-icon'
|
import '@material/mwc-icon'
|
||||||
@ -16,18 +16,18 @@ import '../qort-theme-toggle.js'
|
|||||||
|
|
||||||
import settings from '../../functional-components/settings-page.js'
|
import settings from '../../functional-components/settings-page.js'
|
||||||
import {
|
import {
|
||||||
addAutoLoadImageChat,
|
addAutoLoadImageChat,
|
||||||
removeAutoLoadImageChat,
|
addChatLastSeen,
|
||||||
addChatLastSeen,
|
addTabInfo,
|
||||||
allowQAPPAutoAuth,
|
allowQAPPAutoAuth,
|
||||||
removeQAPPAutoAuth,
|
allowQAPPAutoLists,
|
||||||
removeQAPPAutoLists,
|
removeAutoLoadImageChat,
|
||||||
allowQAPPAutoLists,
|
removeQAPPAutoAuth,
|
||||||
addTabInfo,
|
removeQAPPAutoLists,
|
||||||
setTabNotifications,
|
setNewNotification,
|
||||||
setNewTab,
|
setNewTab,
|
||||||
setNewNotification,
|
setSideEffectAction,
|
||||||
setSideEffectAction
|
setTabNotifications
|
||||||
} from '../../redux/app/app-actions.js'
|
} from '../../redux/app/app-actions.js'
|
||||||
|
|
||||||
window.reduxStore = store
|
window.reduxStore = store
|
||||||
@ -135,7 +135,7 @@ class LoginView extends connect(store)(LitElement) {
|
|||||||
display: block;
|
display: block;
|
||||||
vertical-align: bottom;
|
vertical-align: bottom;
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-page {
|
.login-page {
|
||||||
background: var(--background);
|
background: var(--background);
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { LitElement, html, css } from 'lit'
|
import {css, html, LitElement} from 'lit'
|
||||||
import { translate, translateUnsafeHTML } from 'lit-translate'
|
import {translate} from 'lit-translate'
|
||||||
|
|
||||||
import '@material/mwc-button'
|
import '@material/mwc-button'
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { LitElement, html, css } 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 { doLogout } from '../../redux/app/app-actions.js'
|
import {doLogout} from '../../redux/app/app-actions.js'
|
||||||
import { translate, translateUnsafeHTML } from 'lit-translate'
|
import {translate} from 'lit-translate'
|
||||||
|
|
||||||
import '@polymer/paper-dialog/paper-dialog.js'
|
import '@polymer/paper-dialog/paper-dialog.js'
|
||||||
import '@material/mwc-button'
|
import '@material/mwc-button'
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import { LitElement, html } from 'lit'
|
import {html, LitElement} from 'lit'
|
||||||
import { installRouter } from 'pwa-helpers/router.js'
|
import {installRouter} from 'pwa-helpers/router.js'
|
||||||
import { connect } from 'pwa-helpers'
|
import {connect} from 'pwa-helpers'
|
||||||
import { store } from '../store.js'
|
import {store} from '../store.js'
|
||||||
import { doNavigate } from '../redux/app/app-actions.js'
|
import {doNavigate} from '../redux/app/app-actions.js'
|
||||||
import isElectron from 'is-electron'
|
import isElectron from 'is-electron'
|
||||||
import '../plugins/streams.js'
|
import '../plugins/streams.js'
|
||||||
|
|
||||||
import { loadPlugins } from '../plugins/load-plugins.js'
|
import {loadPlugins} from '../plugins/load-plugins.js'
|
||||||
|
|
||||||
import '../styles/app-styles.js'
|
import '../styles/app-styles.js'
|
||||||
import './login-view/login-view.js'
|
import './login-view/login-view.js'
|
||||||
@ -31,8 +31,8 @@ class MainApp extends connect(store)(LitElement) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dynamic renderViews method to introduce conditional rendering of views based on user's logged in state.
|
* Dynamic renderViews method to introduce conditional rendering of views based on user's logged in state.
|
||||||
* @param {Boolean} isLoggedIn
|
* @param {Boolean} isLoggedIn
|
||||||
*/
|
*/
|
||||||
|
|
||||||
renderViews(isLoggedIn) {
|
renderViews(isLoggedIn) {
|
||||||
|
@ -1,24 +1,19 @@
|
|||||||
import { LitElement, html, css } from 'lit';
|
import {css, html, LitElement} from 'lit';
|
||||||
import { connect } from 'pwa-helpers';
|
import {connect} from 'pwa-helpers';
|
||||||
|
|
||||||
import '@vaadin/item';
|
import '@vaadin/item';
|
||||||
import '@vaadin/list-box';
|
import '@vaadin/list-box';
|
||||||
import '@polymer/paper-icon-button/paper-icon-button.js';
|
import '@polymer/paper-icon-button/paper-icon-button.js';
|
||||||
import '@polymer/iron-icons/iron-icons.js';
|
import '@polymer/iron-icons/iron-icons.js';
|
||||||
import { store } from '../../store.js';
|
import {store} from '../../store.js';
|
||||||
import { setNewNotification, setNewTab } from '../../redux/app/app-actions.js';
|
import {setNewNotification} from '../../redux/app/app-actions.js';
|
||||||
import { routes } from '../../plugins/routes.js';
|
|
||||||
import '@material/mwc-icon';
|
import '@material/mwc-icon';
|
||||||
import { translate, get } from 'lit-translate';
|
import {get, translate} from 'lit-translate';
|
||||||
import { repeat } from 'lit/directives/repeat.js';
|
import {repeat} from 'lit/directives/repeat.js';
|
||||||
|
|
||||||
import config from '../../notifications/config.js';
|
|
||||||
import '../../../../plugins/plugins/core/components/TimeAgo.js';
|
import '../../../../plugins/plugins/core/components/TimeAgo.js';
|
||||||
import './popover.js';
|
import './popover.js';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class NotificationBellGeneral extends connect(store)(LitElement) {
|
class NotificationBellGeneral extends connect(store)(LitElement) {
|
||||||
static properties = {
|
static properties = {
|
||||||
notifications: { type: Array },
|
notifications: { type: Array },
|
||||||
@ -91,7 +86,7 @@ class NotificationBellGeneral extends connect(store)(LitElement) {
|
|||||||
status: statusTx,
|
status: statusTx,
|
||||||
};
|
};
|
||||||
this.notifications = copyNotifications;
|
this.notifications = copyNotifications;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import { LitElement, html, css } from 'lit'
|
import {css, html, LitElement} from 'lit'
|
||||||
import { connect } from 'pwa-helpers'
|
import {connect} from 'pwa-helpers'
|
||||||
|
|
||||||
import '@vaadin/item'
|
import '@vaadin/item'
|
||||||
import '@vaadin/list-box'
|
import '@vaadin/list-box'
|
||||||
import '@polymer/paper-icon-button/paper-icon-button.js'
|
import '@polymer/paper-icon-button/paper-icon-button.js'
|
||||||
import '@polymer/iron-icons/iron-icons.js'
|
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 { routes } from '../../plugins/routes.js'
|
import {routes} from '../../plugins/routes.js'
|
||||||
import '@material/mwc-icon';
|
import '@material/mwc-icon';
|
||||||
|
|
||||||
import config from '../../notifications/config.js'
|
import config from '../../notifications/config.js'
|
||||||
@ -150,7 +150,7 @@ class NotificationBell extends connect(store)(LitElement) {
|
|||||||
hide-delay=${1}
|
hide-delay=${1}
|
||||||
text="Q-Mail">
|
text="Q-Mail">
|
||||||
</vaadin-tooltip>
|
</vaadin-tooltip>
|
||||||
|
|
||||||
` : html`
|
` : html`
|
||||||
<mwc-icon @click=${() => this._openTabQmail()} id="notification-mail-icon" style="color: var(--black); cursor:pointer;user-select:none"
|
<mwc-icon @click=${() => this._openTabQmail()} id="notification-mail-icon" style="color: var(--black); cursor:pointer;user-select:none"
|
||||||
>mail</mwc-icon
|
>mail</mwc-icon
|
||||||
@ -162,7 +162,7 @@ class NotificationBell extends connect(store)(LitElement) {
|
|||||||
hide-delay=${1}
|
hide-delay=${1}
|
||||||
text="Q-Mail">
|
text="Q-Mail">
|
||||||
</vaadin-tooltip>
|
</vaadin-tooltip>
|
||||||
|
|
||||||
`}
|
`}
|
||||||
|
|
||||||
${this.notificationCount ? html`
|
${this.notificationCount ? html`
|
||||||
@ -195,7 +195,7 @@ class NotificationBell extends connect(store)(LitElement) {
|
|||||||
<p>Q-Mail</p>
|
<p>Q-Mail</p>
|
||||||
<message-time timestamp=${notification.created} style="color:red;font-size:12px"></message-time>
|
<message-time timestamp=${notification.created} style="color:red;font-size:12px"></message-time>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<p>${notification.name}</p>
|
<p>${notification.name}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// popover-component.js
|
// popover-component.js
|
||||||
import { LitElement, html, css } 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'
|
||||||
|
|
||||||
export class PopoverComponent extends LitElement {
|
export class PopoverComponent extends LitElement {
|
||||||
@ -24,7 +24,7 @@ export class PopoverComponent extends LitElement {
|
|||||||
color: var(--black)
|
color: var(--black)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
static properties = {
|
static properties = {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { LitElement, html, css } from 'lit'
|
import {css, html, LitElement} from 'lit'
|
||||||
import { svgSun, svgMoon } from '../../assets/js/svg.js'
|
import {svgMoon, svgSun} from '../../assets/js/svg.js'
|
||||||
|
|
||||||
class QortThemeToggle extends LitElement {
|
class QortThemeToggle extends LitElement {
|
||||||
static get properties() {
|
static get properties() {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { LitElement, html, css } from 'lit'
|
import {css, html, LitElement} from 'lit'
|
||||||
import { get, translate, translateUnsafeHTML } from 'lit-translate'
|
import {get, translate} from 'lit-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'
|
||||||
@ -129,4 +129,4 @@ class SearchModal extends LitElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
window.customElements.define('search-modal', SearchModal)
|
window.customElements.define('search-modal', SearchModal)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { LitElement, html, css } 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 'lit-translate'
|
import {translate} from 'lit-translate'
|
||||||
|
|
||||||
class AccountView extends connect(store)(LitElement) {
|
class AccountView extends connect(store)(LitElement) {
|
||||||
static get properties() {
|
static get properties() {
|
||||||
@ -133,4 +133,4 @@ class AccountView extends connect(store)(LitElement) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
window.customElements.define('account-view', AccountView)
|
window.customElements.define('account-view', AccountView)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { LitElement, html, css } 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 { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from 'lit-translate'
|
import {get, translate} from 'lit-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'
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { LitElement, html, css } 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 { doSetQChatNotificationConfig } from '../../redux/user/user-actions.js'
|
import {doSetQChatNotificationConfig} from '../../redux/user/user-actions.js'
|
||||||
import { translate, translateUnsafeHTML } from 'lit-translate'
|
import {translate} from 'lit-translate'
|
||||||
import isElectron from 'is-electron'
|
import isElectron from 'is-electron'
|
||||||
|
|
||||||
import '@material/mwc-checkbox'
|
import '@material/mwc-checkbox'
|
||||||
@ -111,7 +111,7 @@ class NotificationsView extends connect(store)(LitElement) {
|
|||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
transition: all .2s;
|
transition: all .2s;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.remove-button {
|
.remove-button {
|
||||||
font-family: Roboto, sans-serif;
|
font-family: Roboto, sans-serif;
|
||||||
@ -171,7 +171,7 @@ class NotificationsView extends connect(store)(LitElement) {
|
|||||||
<button class="remove-button" @click=${() => this.removeApp(app)}>Remove</button>
|
<button class="remove-button" @click=${() => this.removeApp(app)}>Remove</button>
|
||||||
</div>
|
</div>
|
||||||
`)}
|
`)}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
${this.renderSetCoreButton()}
|
${this.renderSetCoreButton()}
|
||||||
@ -194,7 +194,7 @@ class NotificationsView extends connect(store)(LitElement) {
|
|||||||
// Update the apps list in the component
|
// Update the apps list in the component
|
||||||
this.appNotificationList = this.appNotificationList.filter(app => app !== appName);
|
this.appNotificationList = this.appNotificationList.filter(app => app !== appName);
|
||||||
}
|
}
|
||||||
|
|
||||||
removeAppFromStorage(appName) {
|
removeAppFromStorage(appName) {
|
||||||
// Your method to remove the app from local storage
|
// Your method to remove the app from local storage
|
||||||
const address= store.getState().app.selectedAddress.address
|
const address= store.getState().app.selectedAddress.address
|
||||||
|
@ -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 'lit-translate'
|
import {translate} from 'lit-translate'
|
||||||
|
|
||||||
import '@material/mwc-textfield'
|
import '@material/mwc-textfield'
|
||||||
import '@material/mwc-icon'
|
import '@material/mwc-icon'
|
||||||
@ -59,21 +59,21 @@ class QRLoginView extends connect(store)(LitElement) {
|
|||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
transition: all .2s;
|
transition: all .2s;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.q-button.outlined {
|
.q-button.outlined {
|
||||||
background: unset;
|
background: unset;
|
||||||
border: 1px solid #03a9f4;
|
border: 1px solid #03a9f4;
|
||||||
}
|
}
|
||||||
|
|
||||||
:host([theme="light"]) .q-button.outlined {
|
:host([theme="light"]) .q-button.outlined {
|
||||||
color: #03a9f4;
|
color: #03a9f4;
|
||||||
}
|
}
|
||||||
|
|
||||||
#qr-toggle-button {
|
#qr-toggle-button {
|
||||||
margin-left: 12px;
|
margin-left: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#login-qr-code {
|
#login-qr-code {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
}
|
}
|
||||||
@ -101,7 +101,7 @@ class QRLoginView extends connect(store)(LitElement) {
|
|||||||
<div style="max-width: 600px; display: flex; justify-content: center; margin: auto;">
|
<div style="max-width: 600px; display: flex; justify-content: center; margin: auto;">
|
||||||
<div id="qr-toggle-button" @click=${() => this.showQRCode()} class="q-button outlined"> ${translate(this.translateButtonKey)} </div>
|
<div id="qr-toggle-button" @click=${() => this.showQRCode()} class="q-button outlined"> ${translate(this.translateButtonKey)} </div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="login-qr-code" style="display: none;">
|
<div id="login-qr-code" style="display: none;">
|
||||||
<qortal-qrcode-generator id="login-qr-code" data="${this.savedWalletDataJson}" mode="octet" format="html" auto></qortal-qrcode-generator>
|
<qortal-qrcode-generator id="login-qr-code" data="${this.savedWalletDataJson}" mode="octet" format="html" auto></qortal-qrcode-generator>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,8 +1,14 @@
|
|||||||
import { LitElement, html, css } 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 { allowQAPPAutoAuth, removeQAPPAutoAuth, removeQAPPAutoLists, allowQAPPAutoLists, setIsOpenDevDialog } from '../../redux/app/app-actions.js'
|
import {
|
||||||
import { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from 'lit-translate'
|
allowQAPPAutoAuth,
|
||||||
|
allowQAPPAutoLists,
|
||||||
|
removeQAPPAutoAuth,
|
||||||
|
removeQAPPAutoLists,
|
||||||
|
setIsOpenDevDialog
|
||||||
|
} from '../../redux/app/app-actions.js'
|
||||||
|
import {get, translate} from 'lit-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'
|
||||||
|
|
||||||
@ -75,7 +81,7 @@ class SecurityView extends connect(store)(LitElement) {
|
|||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
transition: all .2s;
|
transition: all .2s;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.add-dev-button {
|
.add-dev-button {
|
||||||
margin-top: 4px;
|
margin-top: 4px;
|
||||||
@ -141,13 +147,13 @@ class SecurityView extends connect(store)(LitElement) {
|
|||||||
<mwc-checkbox style="margin-right: -15px;" id="authButton" @click=${(e) => this.checkForLists(e)} ?checked=${store.getState().app.qAPPAutoLists}></mwc-checkbox>
|
<mwc-checkbox style="margin-right: -15px;" id="authButton" @click=${(e) => this.checkForLists(e)} ?checked=${store.getState().app.qAPPAutoLists}></mwc-checkbox>
|
||||||
</div>
|
</div>
|
||||||
<div class="checkbox-row">
|
<div class="checkbox-row">
|
||||||
<button
|
<button
|
||||||
class="add-dev-button"
|
class="add-dev-button"
|
||||||
title="${translate('tabmenu.tm18')}"
|
title="${translate('tabmenu.tm18')}"
|
||||||
@click=${this.openDevDialog}
|
@click=${this.openDevDialog}
|
||||||
>${translate('tabmenu.tm38')}</button>
|
>${translate('tabmenu.tm38')}</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { LitElement, html, css } 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, translateUnsafeHTML } from 'lit-translate'
|
import {translate} from 'lit-translate'
|
||||||
|
|
||||||
import '@polymer/paper-dialog/paper-dialog.js'
|
import '@polymer/paper-dialog/paper-dialog.js'
|
||||||
import '@material/mwc-button'
|
import '@material/mwc-button'
|
||||||
@ -12,8 +12,6 @@ import './notifications-view.js'
|
|||||||
import './qr-login-view.js'
|
import './qr-login-view.js'
|
||||||
import './export-keys.js'
|
import './export-keys.js'
|
||||||
|
|
||||||
import { doLogout } from '../../redux/app/app-actions.js'
|
|
||||||
|
|
||||||
class UserSettings extends connect(store)(LitElement) {
|
class UserSettings extends connect(store)(LitElement) {
|
||||||
static get properties() {
|
static get properties() {
|
||||||
return {
|
return {
|
||||||
|
@ -1,20 +1,14 @@
|
|||||||
import { LitElement, html, css } from 'lit'
|
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 { Epml } from '../epml.js'
|
import {Epml} from '../epml.js'
|
||||||
import { addPluginRoutes } from '../plugins/addPluginRoutes.js'
|
import {addPluginRoutes} from '../plugins/addPluginRoutes.js'
|
||||||
import { repeat } from 'lit/directives/repeat.js';
|
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 localForage from 'localforage'
|
|
||||||
import FileSaver from 'file-saver'
|
import FileSaver from 'file-saver'
|
||||||
import { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from 'lit-translate'
|
import {get, registerTranslateConfig, translate, use} from 'lit-translate'
|
||||||
|
|
||||||
registerTranslateConfig({
|
|
||||||
loader: lang => fetch(`/language/${lang}.json`).then(res => res.json())
|
|
||||||
})
|
|
||||||
|
|
||||||
import '@material/mwc-button'
|
import '@material/mwc-button'
|
||||||
import '@material/mwc-dialog'
|
import '@material/mwc-dialog'
|
||||||
import '@material/mwc-icon'
|
import '@material/mwc-icon'
|
||||||
@ -26,6 +20,9 @@ import '@vaadin/grid'
|
|||||||
import '@vaadin/text-field'
|
import '@vaadin/text-field'
|
||||||
import '../custom-elements/frag-file-input.js'
|
import '../custom-elements/frag-file-input.js'
|
||||||
|
|
||||||
|
registerTranslateConfig({
|
||||||
|
loader: lang => fetch(`/language/${lang}.json`).then(res => res.json())
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
export const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
|
export const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
|
||||||
@ -91,7 +88,7 @@ class ShowPlugin extends connect(store)(LitElement) {
|
|||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
border: 3px solid var(--scrollbarBG);
|
border: 3px solid var(--scrollbarBG);
|
||||||
}
|
}
|
||||||
|
|
||||||
.hideIframe {
|
.hideIframe {
|
||||||
display: none;
|
display: none;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@ -435,7 +432,7 @@ class ShowPlugin extends connect(store)(LitElement) {
|
|||||||
}}"
|
}}"
|
||||||
@mousedown="${(event) => {
|
@mousedown="${(event) => {
|
||||||
if (event.button === 1) {
|
if (event.button === 1) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
this.removeTab(index, tab.id);
|
this.removeTab(index, tab.id);
|
||||||
}
|
}
|
||||||
}}"
|
}}"
|
||||||
@ -446,8 +443,8 @@ class ShowPlugin extends connect(store)(LitElement) {
|
|||||||
` : html`
|
` : html`
|
||||||
<mwc-icon>${icon}</mwc-icon>
|
<mwc-icon>${icon}</mwc-icon>
|
||||||
`}
|
`}
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="tabCard">
|
<div class="tabCard">
|
||||||
${count ? html`
|
${count ? html`
|
||||||
@ -455,7 +452,7 @@ class ShowPlugin extends connect(store)(LitElement) {
|
|||||||
<span class="count ml-5">${count}</span>
|
<span class="count ml-5">${count}</span>
|
||||||
<span class="show ml-25"><mwc-icon class="close" @click=${(event) => {
|
<span class="show ml-25"><mwc-icon class="close" @click=${(event) => {
|
||||||
event.stopPropagation(); this.removeTab(index, tab.id)
|
event.stopPropagation(); this.removeTab(index, tab.id)
|
||||||
|
|
||||||
}}>close</mwc-icon></span>
|
}}>close</mwc-icon></span>
|
||||||
` : html`
|
` : html`
|
||||||
<span class="tabTitle ml-30">${title}</span>
|
<span class="tabTitle ml-30">${title}</span>
|
||||||
@ -465,7 +462,7 @@ class ShowPlugin extends connect(store)(LitElement) {
|
|||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
})}
|
})}
|
||||||
<button
|
<button
|
||||||
class="add-tab-button"
|
class="add-tab-button"
|
||||||
title="${translate('tabmenu.tm18')}"
|
title="${translate('tabmenu.tm18')}"
|
||||||
@click=${() => {
|
@click=${() => {
|
||||||
@ -475,7 +472,7 @@ class ShowPlugin extends connect(store)(LitElement) {
|
|||||||
id: this.uid.rnd()
|
id: this.uid.rnd()
|
||||||
})
|
})
|
||||||
this.currentTab = lengthOfTabs
|
this.currentTab = lengthOfTabs
|
||||||
|
|
||||||
}}
|
}}
|
||||||
>+</button>
|
>+</button>
|
||||||
</div>
|
</div>
|
||||||
@ -499,8 +496,8 @@ class ShowPlugin extends connect(store)(LitElement) {
|
|||||||
</nav-bar>
|
</nav-bar>
|
||||||
</div>
|
</div>
|
||||||
`)}
|
`)}
|
||||||
<mwc-dialog id="addDevDialog"
|
<mwc-dialog id="addDevDialog"
|
||||||
?open=${this.isOpenDevDialog}
|
?open=${this.isOpenDevDialog}
|
||||||
@closed=${() => {
|
@closed=${() => {
|
||||||
this.shadowRoot.getElementById('domainInput').value = ''
|
this.shadowRoot.getElementById('domainInput').value = ''
|
||||||
this.shadowRoot.getElementById('portInput').value = ''
|
this.shadowRoot.getElementById('portInput').value = ''
|
||||||
@ -531,7 +528,7 @@ class ShowPlugin extends connect(store)(LitElement) {
|
|||||||
>
|
>
|
||||||
${translate('tabmenu.tm40')}
|
${translate('tabmenu.tm40')}
|
||||||
</mwc-button>
|
</mwc-button>
|
||||||
</mwc-dialog>
|
</mwc-dialog>
|
||||||
`
|
`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1018,22 +1015,22 @@ class NavBar extends connect(store)(LitElement) {
|
|||||||
--mdc-icon-size: 64px;
|
--mdc-icon-size: 64px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.menuIconPos {
|
.menuIconPos {
|
||||||
right: -2px;
|
right: -2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.removeIconPos {
|
.removeIconPos {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: -10px;
|
top: -10px;
|
||||||
right: -10px;
|
right: -10px;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.menuIconPos:hover .removeIcon {
|
.menuIconPos:hover .removeIcon {
|
||||||
display: inline;
|
display: inline;
|
||||||
}
|
}
|
||||||
|
|
||||||
.removeIcon {
|
.removeIcon {
|
||||||
display: none;
|
display: none;
|
||||||
color: var(--black);
|
color: var(--black);
|
||||||
@ -1042,7 +1039,7 @@ class NavBar extends connect(store)(LitElement) {
|
|||||||
position: relative;
|
position: relative;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.removeIcon:hover {
|
.removeIcon:hover {
|
||||||
color: #C6011F;
|
color: #C6011F;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
@ -1479,7 +1476,7 @@ class NavBar extends connect(store)(LitElement) {
|
|||||||
const addressInfo = this.addressInfo
|
const addressInfo = this.addressInfo
|
||||||
const isMinter = addressInfo?.error !== 124 && +addressInfo?.level > 0
|
const isMinter = addressInfo?.error !== 124 && +addressInfo?.level > 0
|
||||||
const isSponsor = +addressInfo?.level >= 5
|
const isSponsor = +addressInfo?.level >= 5
|
||||||
|
|
||||||
|
|
||||||
if (!isMinter) {
|
if (!isMinter) {
|
||||||
this.newMenuList = this.myMenuPlugins.filter((minter) => {
|
this.newMenuList = this.myMenuPlugins.filter((minter) => {
|
||||||
@ -1498,7 +1495,7 @@ class NavBar extends connect(store)(LitElement) {
|
|||||||
} else {
|
} else {
|
||||||
this.myMenuList = this.newMenuList
|
this.myMenuList = this.newMenuList
|
||||||
}
|
}
|
||||||
|
|
||||||
this.requestUpdate()
|
this.requestUpdate()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2208,7 +2205,7 @@ class NavBar extends connect(store)(LitElement) {
|
|||||||
|
|
||||||
renderRemoveIcon(appurl, appicon, appname, appid, appplugin) {
|
renderRemoveIcon(appurl, appicon, appname, appid, appplugin) {
|
||||||
return html`
|
return html`
|
||||||
|
|
||||||
<div class="menuIconPos" @click="${() => this.changePage(appplugin)}">
|
<div class="menuIconPos" @click="${() => this.changePage(appplugin)}">
|
||||||
<div class="removeIconPos" title="${translate('tabmenu.tm22')}" @click="${(event) => {
|
<div class="removeIconPos" title="${translate('tabmenu.tm22')}" @click="${(event) => {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
@ -2452,14 +2449,14 @@ class AppAvatar extends LitElement {
|
|||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super()
|
super()
|
||||||
|
|
||||||
this.hasAvatar = false
|
this.hasAvatar = false
|
||||||
this.isImageLoaded = false
|
this.isImageLoaded = false
|
||||||
this.imageFetches = 0
|
this.imageFetches = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles() {
|
static get styles() {
|
||||||
|
|
||||||
return css`
|
return css`
|
||||||
:host {
|
:host {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@ -2477,16 +2474,16 @@ class AppAvatar extends LitElement {
|
|||||||
|
|
||||||
`
|
`
|
||||||
}
|
}
|
||||||
|
|
||||||
createImage(imageUrl) {
|
createImage(imageUrl) {
|
||||||
const imageHTMLRes = new Image();
|
const imageHTMLRes = new Image();
|
||||||
imageHTMLRes.src = imageUrl;
|
imageHTMLRes.src = imageUrl;
|
||||||
imageHTMLRes.style= "border-radius:10px; font-size:14px; object-fit: fill;height:60px;width:60px";
|
imageHTMLRes.style= "border-radius:10px; font-size:14px; object-fit: fill;height:60px;width:60px";
|
||||||
|
|
||||||
imageHTMLRes.onload = () => {
|
imageHTMLRes.onload = () => {
|
||||||
this.isImageLoaded = true;
|
this.isImageLoaded = true;
|
||||||
}
|
}
|
||||||
imageHTMLRes.onerror = () => {
|
imageHTMLRes.onerror = () => {
|
||||||
if (this.imageFetches < 1) {
|
if (this.imageFetches < 1) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.imageFetches = this.imageFetches + 1;
|
this.imageFetches = this.imageFetches + 1;
|
||||||
@ -2533,23 +2530,23 @@ class TabAvatar extends LitElement {
|
|||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super()
|
super()
|
||||||
|
|
||||||
this.hasAvatar = false
|
this.hasAvatar = false
|
||||||
this.isImageLoaded = false
|
this.isImageLoaded = false
|
||||||
this.imageFetches = 0
|
this.imageFetches = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
createImage(imageUrl) {
|
createImage(imageUrl) {
|
||||||
const imageHTMLRes = new Image();
|
const imageHTMLRes = new Image();
|
||||||
imageHTMLRes.src = imageUrl;
|
imageHTMLRes.src = imageUrl;
|
||||||
imageHTMLRes.style= "border-radius:4px; font-size:14px; object-fit: fill;height:24px;width:24px";
|
imageHTMLRes.style= "border-radius:4px; font-size:14px; object-fit: fill;height:24px;width:24px";
|
||||||
|
|
||||||
imageHTMLRes.onload = () => {
|
imageHTMLRes.onload = () => {
|
||||||
this.isImageLoaded = true;
|
this.isImageLoaded = true;
|
||||||
}
|
}
|
||||||
imageHTMLRes.onerror = () => {
|
imageHTMLRes.onerror = () => {
|
||||||
if (this.imageFetches < 1) {
|
if (this.imageFetches < 1) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.imageFetches = this.imageFetches + 1;
|
this.imageFetches = this.imageFetches + 1;
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import { LitElement, html, css } 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, get } from 'lit-translate';
|
import {get, translate} from 'lit-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';
|
||||||
import { routes } from '../plugins/routes.js';
|
import {routes} from '../plugins/routes.js';
|
||||||
import "@material/mwc-button"
|
import "@material/mwc-button"
|
||||||
import '@material/mwc-dialog'
|
import '@material/mwc-dialog'
|
||||||
|
|
||||||
@ -278,7 +278,7 @@ const nonce = selectedAddress && selectedAddress.nonce;
|
|||||||
findMintingAccountFromOtherUser.publicKey[0]
|
findMintingAccountFromOtherUser.publicKey[0]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.errorMsg = this.renderErrorMsg2();
|
this.errorMsg = this.renderErrorMsg2();
|
||||||
return;
|
return;
|
||||||
@ -344,7 +344,7 @@ const nonce = selectedAddress && selectedAddress.nonce;
|
|||||||
const publicAddress = this.base58PublicKey
|
const publicAddress = this.base58PublicKey
|
||||||
const findMintingAccount = mintingAccountData.find((ma) => ma.mintingAccount === address);
|
const findMintingAccount = mintingAccountData.find((ma) => ma.mintingAccount === address);
|
||||||
const isMinterButKeyMintingKeyNotAssigned = addressInfo && addressInfo.error !== 124 && addressInfo.level >= 1 && !findMintingAccount;
|
const isMinterButKeyMintingKeyNotAssigned = addressInfo && addressInfo.error !== 124 && addressInfo.level >= 1 && !findMintingAccount;
|
||||||
|
|
||||||
const makeTransactionRequest = async (lastRef) => {
|
const makeTransactionRequest = async (lastRef) => {
|
||||||
let mylastRef = lastRef;
|
let mylastRef = lastRef;
|
||||||
let rewarddialog1 = get('transactions.rewarddialog1');
|
let rewarddialog1 = get('transactions.rewarddialog1');
|
||||||
@ -373,12 +373,12 @@ const nonce = selectedAddress && selectedAddress.nonce;
|
|||||||
|
|
||||||
const getTxnRequestResponse = (txnResponse) => {
|
const getTxnRequestResponse = (txnResponse) => {
|
||||||
let err6string = get('rewardsharepage.rchange21');
|
let err6string = get('rewardsharepage.rchange21');
|
||||||
|
|
||||||
if (txnResponse && txnResponse.extraData && txnResponse.extraData.rewardSharePrivateKey &&
|
if (txnResponse && txnResponse.extraData && txnResponse.extraData.rewardSharePrivateKey &&
|
||||||
txnResponse.data && (txnResponse.data.message && (txnResponse.data.message.includes('multiple') || txnResponse.data.message.includes('SELF_SHARE_EXISTS')))) {
|
txnResponse.data && (txnResponse.data.message && (txnResponse.data.message.includes('multiple') || txnResponse.data.message.includes('SELF_SHARE_EXISTS')))) {
|
||||||
return err6string;
|
return err6string;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (txnResponse.success === false && txnResponse.message) {
|
if (txnResponse.success === false && txnResponse.message) {
|
||||||
throw txnResponse;
|
throw txnResponse;
|
||||||
} else if (txnResponse.success === true && txnResponse.data && !txnResponse.data.error) {
|
} else if (txnResponse.success === true && txnResponse.data && !txnResponse.data.error) {
|
||||||
@ -387,19 +387,19 @@ const nonce = selectedAddress && selectedAddress.nonce;
|
|||||||
throw txnResponse;
|
throw txnResponse;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const createSponsorshipKey = async () => {
|
const createSponsorshipKey = async () => {
|
||||||
this.status = 1;
|
this.status = 1;
|
||||||
let lastRef = await getLastRef();
|
let lastRef = await getLastRef();
|
||||||
let myTransaction = await makeTransactionRequest(lastRef);
|
let myTransaction = await makeTransactionRequest(lastRef);
|
||||||
getTxnRequestResponse(myTransaction);
|
getTxnRequestResponse(myTransaction);
|
||||||
|
|
||||||
if (myTransaction && myTransaction.extraData) {
|
if (myTransaction && myTransaction.extraData) {
|
||||||
return myTransaction.extraData.rewardSharePrivateKey;
|
return myTransaction.extraData.rewardSharePrivateKey;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const getLastRef = async () => {
|
const getLastRef = async () => {
|
||||||
const url = `${nodeUrl}/addresses/lastreference/${address}`;
|
const url = `${nodeUrl}/addresses/lastreference/${address}`;
|
||||||
@ -448,7 +448,7 @@ const nonce = selectedAddress && selectedAddress.nonce;
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Dialog for tracking the progress of starting minting -->
|
<!-- Dialog for tracking the progress of starting minting -->
|
||||||
|
|
||||||
${this.openDialogRewardShare ? html`
|
${this.openDialogRewardShare ? html`
|
||||||
<div class="dialogCustom">
|
<div class="dialogCustom">
|
||||||
<div class="dialogCustomInner">
|
<div class="dialogCustomInner">
|
||||||
@ -502,7 +502,7 @@ const nonce = selectedAddress && selectedAddress.nonce;
|
|||||||
Warning: do not close the Qortal UI until completion!
|
Warning: do not close the Qortal UI until completion!
|
||||||
</p>
|
</p>
|
||||||
<p class="message-error">${this.errorMsg}</p>
|
<p class="message-error">${this.errorMsg}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modalFooter">
|
<div class="modalFooter">
|
||||||
${this.errorMsg || this.status === 5 ? html`
|
${this.errorMsg || this.status === 5 ? html`
|
||||||
@ -520,8 +520,8 @@ const nonce = selectedAddress && selectedAddress.nonce;
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
` : ""}
|
` : ""}
|
||||||
` : ''}
|
` : ''}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { LitElement, html, css } from 'lit'
|
import {css, html, LitElement} from 'lit'
|
||||||
import { get, translate, translateUnsafeHTML } from 'lit-translate'
|
import {translate} from 'lit-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'
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { LitElement, html, css } from 'lit'
|
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, translateUnsafeHTML } from 'lit-translate'
|
import {get, translate} from 'lit-translate'
|
||||||
|
|
||||||
import '@polymer/paper-dialog/paper-dialog.js'
|
import '@polymer/paper-dialog/paper-dialog.js'
|
||||||
import '@material/mwc-button'
|
import '@material/mwc-button'
|
||||||
@ -354,7 +354,7 @@ class UserInfoView extends connect(store)(LitElement) {
|
|||||||
|
|
||||||
.border-wrapper {
|
.border-wrapper {
|
||||||
border: 1px var(--tradeborder) solid;
|
border: 1px var(--tradeborder) solid;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1531,7 +1531,7 @@ class UserInfoView extends connect(store)(LitElement) {
|
|||||||
creatorAddress: item.creatorAddress,
|
creatorAddress: item.creatorAddress,
|
||||||
recipient: item.recipient,
|
recipient: item.recipient,
|
||||||
amount: item.amount
|
amount: item.amount
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).filter(item => !!item)
|
}).filter(item => !!item)
|
||||||
@ -1548,7 +1548,7 @@ class UserInfoView extends connect(store)(LitElement) {
|
|||||||
creatorAddress: item.creatorAddress,
|
creatorAddress: item.creatorAddress,
|
||||||
recipient: item.recipient,
|
recipient: item.recipient,
|
||||||
amount: item.amount
|
amount: item.amount
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).filter(item => !!item)
|
}).filter(item => !!item)
|
||||||
@ -1594,7 +1594,7 @@ class UserInfoView extends connect(store)(LitElement) {
|
|||||||
return {
|
return {
|
||||||
timestamp: item.tradeTimestamp,
|
timestamp: item.tradeTimestamp,
|
||||||
foreignAmount: item.foreignAmount,
|
foreignAmount: item.foreignAmount,
|
||||||
qortAmount: item.qortAmount
|
qortAmount: item.qortAmount
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).filter(item => !!item)
|
}).filter(item => !!item)
|
||||||
@ -1616,7 +1616,7 @@ class UserInfoView extends connect(store)(LitElement) {
|
|||||||
return {
|
return {
|
||||||
timestamp: item.tradeTimestamp,
|
timestamp: item.tradeTimestamp,
|
||||||
foreignAmount: item.foreignAmount,
|
foreignAmount: item.foreignAmount,
|
||||||
qortAmount: item.qortAmount
|
qortAmount: item.qortAmount
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).filter(item => !!item)
|
}).filter(item => !!item)
|
||||||
@ -1638,7 +1638,7 @@ class UserInfoView extends connect(store)(LitElement) {
|
|||||||
return {
|
return {
|
||||||
timestamp: item.tradeTimestamp,
|
timestamp: item.tradeTimestamp,
|
||||||
foreignAmount: item.foreignAmount,
|
foreignAmount: item.foreignAmount,
|
||||||
qortAmount: item.qortAmount
|
qortAmount: item.qortAmount
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).filter(item => !!item)
|
}).filter(item => !!item)
|
||||||
@ -1660,7 +1660,7 @@ class UserInfoView extends connect(store)(LitElement) {
|
|||||||
return {
|
return {
|
||||||
timestamp: item.tradeTimestamp,
|
timestamp: item.tradeTimestamp,
|
||||||
foreignAmount: item.foreignAmount,
|
foreignAmount: item.foreignAmount,
|
||||||
qortAmount: item.qortAmount
|
qortAmount: item.qortAmount
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).filter(item => !!item)
|
}).filter(item => !!item)
|
||||||
@ -1682,7 +1682,7 @@ class UserInfoView extends connect(store)(LitElement) {
|
|||||||
return {
|
return {
|
||||||
timestamp: item.tradeTimestamp,
|
timestamp: item.tradeTimestamp,
|
||||||
foreignAmount: item.foreignAmount,
|
foreignAmount: item.foreignAmount,
|
||||||
qortAmount: item.qortAmount
|
qortAmount: item.qortAmount
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).filter(item => !!item)
|
}).filter(item => !!item)
|
||||||
@ -1704,7 +1704,7 @@ class UserInfoView extends connect(store)(LitElement) {
|
|||||||
return {
|
return {
|
||||||
timestamp: item.tradeTimestamp,
|
timestamp: item.tradeTimestamp,
|
||||||
foreignAmount: item.foreignAmount,
|
foreignAmount: item.foreignAmount,
|
||||||
qortAmount: item.qortAmount
|
qortAmount: item.qortAmount
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).filter(item => !!item)
|
}).filter(item => !!item)
|
||||||
@ -1726,7 +1726,7 @@ class UserInfoView extends connect(store)(LitElement) {
|
|||||||
return {
|
return {
|
||||||
timestamp: item.tradeTimestamp,
|
timestamp: item.tradeTimestamp,
|
||||||
foreignAmount: item.foreignAmount,
|
foreignAmount: item.foreignAmount,
|
||||||
qortAmount: item.qortAmount
|
qortAmount: item.qortAmount
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).filter(item => !!item)
|
}).filter(item => !!item)
|
||||||
@ -1748,7 +1748,7 @@ class UserInfoView extends connect(store)(LitElement) {
|
|||||||
return {
|
return {
|
||||||
timestamp: item.tradeTimestamp,
|
timestamp: item.tradeTimestamp,
|
||||||
foreignAmount: item.foreignAmount,
|
foreignAmount: item.foreignAmount,
|
||||||
qortAmount: item.qortAmount
|
qortAmount: item.qortAmount
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).filter(item => !!item)
|
}).filter(item => !!item)
|
||||||
@ -1770,7 +1770,7 @@ class UserInfoView extends connect(store)(LitElement) {
|
|||||||
return {
|
return {
|
||||||
timestamp: item.tradeTimestamp,
|
timestamp: item.tradeTimestamp,
|
||||||
foreignAmount: item.foreignAmount,
|
foreignAmount: item.foreignAmount,
|
||||||
qortAmount: item.qortAmount
|
qortAmount: item.qortAmount
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).filter(item => !!item)
|
}).filter(item => !!item)
|
||||||
@ -1792,7 +1792,7 @@ class UserInfoView extends connect(store)(LitElement) {
|
|||||||
return {
|
return {
|
||||||
timestamp: item.tradeTimestamp,
|
timestamp: item.tradeTimestamp,
|
||||||
foreignAmount: item.foreignAmount,
|
foreignAmount: item.foreignAmount,
|
||||||
qortAmount: item.qortAmount
|
qortAmount: item.qortAmount
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).filter(item => !!item)
|
}).filter(item => !!item)
|
||||||
@ -1814,7 +1814,7 @@ class UserInfoView extends connect(store)(LitElement) {
|
|||||||
return {
|
return {
|
||||||
timestamp: item.tradeTimestamp,
|
timestamp: item.tradeTimestamp,
|
||||||
foreignAmount: item.foreignAmount,
|
foreignAmount: item.foreignAmount,
|
||||||
qortAmount: item.qortAmount
|
qortAmount: item.qortAmount
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).filter(item => !!item)
|
}).filter(item => !!item)
|
||||||
@ -1836,7 +1836,7 @@ class UserInfoView extends connect(store)(LitElement) {
|
|||||||
return {
|
return {
|
||||||
timestamp: item.tradeTimestamp,
|
timestamp: item.tradeTimestamp,
|
||||||
foreignAmount: item.foreignAmount,
|
foreignAmount: item.foreignAmount,
|
||||||
qortAmount: item.qortAmount
|
qortAmount: item.qortAmount
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).filter(item => !!item)
|
}).filter(item => !!item)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { LitElement, html, css } 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, translateUnsafeHTML } from 'lit-translate'
|
import {translate} from 'lit-translate'
|
||||||
|
|
||||||
import '@polymer/paper-toast'
|
import '@polymer/paper-toast'
|
||||||
import '@material/mwc-icon-button'
|
import '@material/mwc-icon-button'
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import { LitElement, html, css } from 'lit'
|
import {css, html, LitElement} from 'lit'
|
||||||
|
|
||||||
import '@material/mwc-button'
|
import '@material/mwc-button'
|
||||||
import '@material/mwc-icon'
|
import '@material/mwc-icon'
|
||||||
|
|
||||||
import { translate, translateUnsafeHTML } from 'lit-translate'
|
import {translate} from 'lit-translate'
|
||||||
|
|
||||||
class FragFileInput extends LitElement {
|
class FragFileInput extends LitElement {
|
||||||
static get properties () {
|
static get properties () {
|
||||||
|
@ -1,4 +1,12 @@
|
|||||||
import { Epml, EpmlReadyPlugin, RequestPlugin, ContentWindow as EpmlContentWindowPlugin, EpmlStreamPlugin, EpmlProxyPlugin, EpmlStream } from 'epml'
|
import {
|
||||||
|
ContentWindow as EpmlContentWindowPlugin,
|
||||||
|
Epml,
|
||||||
|
EpmlProxyPlugin,
|
||||||
|
EpmlReadyPlugin,
|
||||||
|
EpmlStream,
|
||||||
|
EpmlStreamPlugin,
|
||||||
|
RequestPlugin
|
||||||
|
} from 'epml'
|
||||||
|
|
||||||
Epml.registerPlugin(RequestPlugin)
|
Epml.registerPlugin(RequestPlugin)
|
||||||
Epml.registerPlugin(EpmlReadyPlugin)
|
Epml.registerPlugin(EpmlReadyPlugin)
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import { LitElement, html, css } 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, translateUnsafeHTML } from 'lit-translate'
|
import {get, translate} from 'lit-translate'
|
||||||
|
|
||||||
import { listenForRequest } from '../transactionRequest.js'
|
import {listenForRequest} from '../transactionRequest.js'
|
||||||
|
|
||||||
import '@polymer/paper-dialog/paper-dialog.js'
|
import '@polymer/paper-dialog/paper-dialog.js'
|
||||||
import '@material/mwc-button'
|
import '@material/mwc-button'
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { LitElement, html, css } from 'lit'
|
import {css, html, LitElement} from 'lit'
|
||||||
|
|
||||||
const TRANSITION_EVENT_NAMES = ['transitionend', 'webkitTransitionEnd', 'oTransitionEnd', 'MSTransitionEnd']
|
const TRANSITION_EVENT_NAMES = ['transitionend', 'webkitTransitionEnd', 'oTransitionEnd', 'MSTransitionEnd']
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ class LoadingRipple extends LitElement {
|
|||||||
opacity: 1;
|
opacity: 1;
|
||||||
transition: var(--ripple-activating-transition);
|
transition: var(--ripple-activating-transition);
|
||||||
}
|
}
|
||||||
|
|
||||||
`
|
`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { LitElement, html, css } from 'lit';
|
import {css, html, LitElement} from 'lit';
|
||||||
import '@vaadin/button';
|
import '@vaadin/button';
|
||||||
import '@polymer/paper-spinner/paper-spinner-lite.js';
|
import '@polymer/paper-spinner/paper-spinner-lite.js';
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { LitElement, html, css } 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 { testApiKey } from '../apiKeyUtils.js'
|
import {testApiKey} from '../apiKeyUtils.js'
|
||||||
import { get, translate, translateUnsafeHTML } from 'lit-translate'
|
import {get, translate} from 'lit-translate'
|
||||||
|
|
||||||
import '@material/mwc-dialog'
|
import '@material/mwc-dialog'
|
||||||
import '@material/mwc-button'
|
import '@material/mwc-button'
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Author: irontiga <irontiga@gmail.com>
|
// Author: irontiga <irontiga@gmail.com>
|
||||||
|
|
||||||
'use strict'
|
'use strict'
|
||||||
import { LitElement, html, css } from 'lit'
|
import {html, LitElement} from 'lit'
|
||||||
import * as WORDLISTS from './wordlists.js'
|
import * as WORDLISTS from './wordlists.js'
|
||||||
|
|
||||||
class RandomSentenceGenerator extends LitElement {
|
class RandomSentenceGenerator extends LitElement {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { LitElement, html, css } 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 { doAddNode, doSetNode, doLoadNodeConfig, doRemoveNode, doEditNode } from '../redux/app/app-actions.js'
|
import {doAddNode, doEditNode, doLoadNodeConfig, doRemoveNode, doSetNode} from '../redux/app/app-actions.js'
|
||||||
import { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from 'lit-translate'
|
import {get, registerTranslateConfig, translate, use} from 'lit-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'
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { css } from 'lit'
|
import {css} from 'lit'
|
||||||
|
|
||||||
export const sideMenuItemStyle = css`
|
export const sideMenuItemStyle = css`
|
||||||
:host {
|
:host {
|
||||||
@ -21,7 +21,7 @@ export const sideMenuItemStyle = css`
|
|||||||
|
|
||||||
--overlay-box-shadow: 0 2px 4px -1px hsla(214, 53%, 23%, 0.16), 0 3px 12px -1px hsla(214, 50%, 22%, 0.26);
|
--overlay-box-shadow: 0 2px 4px -1px hsla(214, 53%, 23%, 0.16), 0 3px 12px -1px hsla(214, 50%, 22%, 0.26);
|
||||||
--overlay-background-color: #ffffff;
|
--overlay-background-color: #ffffff;
|
||||||
|
|
||||||
--spacing: 4px;
|
--spacing: 4px;
|
||||||
|
|
||||||
font-family: var(--font-family);
|
font-family: var(--font-family);
|
||||||
@ -86,7 +86,7 @@ export const sideMenuItemStyle = css`
|
|||||||
:host([expanded]){
|
:host([expanded]){
|
||||||
background-color: var(--item-selected-color);
|
background-color: var(--item-selected-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
:host([hasSelectedChild]){
|
:host([hasSelectedChild]){
|
||||||
background-color: var(--item-selected-color);
|
background-color: var(--item-selected-color);
|
||||||
}
|
}
|
||||||
@ -109,7 +109,7 @@ export const sideMenuItemStyle = css`
|
|||||||
}
|
}
|
||||||
|
|
||||||
#collapse-button {
|
#collapse-button {
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
:host([compact]) #itemLink[level]:not([level="0"]) {
|
:host([compact]) #itemLink[level]:not([level="0"]) {
|
||||||
@ -143,7 +143,7 @@ export const sideMenuItemStyle = css`
|
|||||||
z-index: 1;
|
z-index: 1;
|
||||||
animation: pop 200ms forwards;
|
animation: pop 200ms forwards;
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes pop{
|
@keyframes pop{
|
||||||
0% {
|
0% {
|
||||||
transform: translateX(-5px);
|
transform: translateX(-5px);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { LitElement, html, css } from 'lit'
|
import {css, html, LitElement} from 'lit'
|
||||||
import { ifDefined } from 'lit/directives/if-defined.js'
|
import {ifDefined} from 'lit/directives/if-defined.js'
|
||||||
import { sideMenuItemStyle } from './side-menu-item-style.js'
|
import {sideMenuItemStyle} from './side-menu-item-style.js'
|
||||||
import '@vaadin/icon'
|
import '@vaadin/icon'
|
||||||
import '@vaadin/icons'
|
import '@vaadin/icons'
|
||||||
import '@polymer/paper-tooltip'
|
import '@polymer/paper-tooltip'
|
||||||
@ -50,8 +50,8 @@ export class SideMenuItem extends LitElement {
|
|||||||
|
|
||||||
_itemLinkTemplate() {
|
_itemLinkTemplate() {
|
||||||
return html`
|
return html`
|
||||||
<a id="itemLink"
|
<a id="itemLink"
|
||||||
level=${this._getLevel}
|
level=${this._getLevel}
|
||||||
href=${this.href || '#!'}
|
href=${this.href || '#!'}
|
||||||
@click="${(e) => this._onClick(e)}"
|
@click="${(e) => this._onClick(e)}"
|
||||||
target=${ifDefined(this.target)}
|
target=${ifDefined(this.target)}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import {LitElement, html, css} from 'lit'
|
import {css, html, LitElement} from 'lit'
|
||||||
|
|
||||||
class SideMenu extends LitElement {
|
class SideMenu extends LitElement {
|
||||||
static get properties() {
|
static get properties() {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { LitElement, html, css } from 'lit'
|
import {css, html, LitElement} from 'lit'
|
||||||
import '@material/mwc-snackbar'
|
import '@material/mwc-snackbar'
|
||||||
|
|
||||||
let queueElement
|
let queueElement
|
||||||
|
File diff suppressed because one or more lines are too long
@ -1,11 +1,11 @@
|
|||||||
import { store } from './store.js'
|
import {store} from './store.js'
|
||||||
import { doLoadConfigFromAPI } from './redux/config/config-actions.js'
|
import {doLoadConfigFromAPI} from './redux/config/config-actions.js'
|
||||||
import { doLoadNodeConfig, doInitWorkers } from './redux/app/app-actions.js'
|
import {doInitWorkers, doLoadNodeConfig} from './redux/app/app-actions.js'
|
||||||
import { doLoadNotificationConfig } from './redux/user/user-actions.js'
|
import {doLoadNotificationConfig} from './redux/user/user-actions.js'
|
||||||
|
|
||||||
import './persistState.js'
|
import './persistState.js'
|
||||||
|
|
||||||
import { initApi } from 'qortal-ui-crypto'
|
import {initApi} from 'qortal-ui-crypto'
|
||||||
|
|
||||||
initApi(store)
|
initApi(store)
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import CryptoJS from 'crypto-js'
|
import CryptoJS from 'crypto-js'
|
||||||
|
|
||||||
export const encryptData = (data, salt) => CryptoJS.AES.encrypt(JSON.stringify(data), salt).toString()
|
export const encryptData = (data, salt) => CryptoJS.AES.encrypt(JSON.stringify(data), salt).toString()
|
||||||
export const decryptData = (ciphertext, salt) => {
|
export const decryptData = (ciphertext, salt) => {
|
||||||
const bytes = CryptoJS.AES.decrypt(ciphertext, salt)
|
const bytes = CryptoJS.AES.decrypt(ciphertext, salt)
|
||||||
try {
|
try {
|
||||||
@ -8,4 +8,4 @@ export const decryptData = (ciphertext, salt) => {
|
|||||||
} catch(err) {
|
} catch(err) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import config from './config'
|
import config from './config'
|
||||||
import { dispatcher } from './dispatcher'
|
import {dispatcher} from './dispatcher'
|
||||||
import snackbar from '../functional-components/snackbar.js'
|
import snackbar from '../functional-components/snackbar.js'
|
||||||
import { NEW_MESSAGE, NEW_MESSAGE_NOTIFICATION_QAPP, NEW_MESSAGE_NOTIFICATION_QAPP_LOCAL } from './types'
|
import {NEW_MESSAGE, NEW_MESSAGE_NOTIFICATION_QAPP, NEW_MESSAGE_NOTIFICATION_QAPP_LOCAL} from './types'
|
||||||
|
|
||||||
let initial = 0
|
let initial = 0
|
||||||
let _state
|
let _state
|
||||||
@ -44,7 +44,7 @@ const notificationCheck = function () {
|
|||||||
|
|
||||||
export const doNewMessage = function (req) {
|
export const doNewMessage = function (req) {
|
||||||
const newMessage = () => {
|
const newMessage = () => {
|
||||||
|
|
||||||
let data
|
let data
|
||||||
if (req.type && req.type === 'qapp') {
|
if (req.type && req.type === 'qapp') {
|
||||||
data = req
|
data = req
|
||||||
@ -73,7 +73,7 @@ export const doNewMessage = function (req) {
|
|||||||
} else {
|
} else {
|
||||||
_state = notificationState
|
_state = notificationState
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const page = window.top.location.href
|
const page = window.top.location.href
|
||||||
if(req.type && req.type === 'qapp-local-notification'){
|
if(req.type && req.type === 'qapp-local-notification'){
|
||||||
try {
|
try {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { NEW_MESSAGE, NEW_MESSAGE_NOTIFICATION_QAPP, NEW_MESSAGE_NOTIFICATION_QAPP_LOCAL } from './types'
|
import {NEW_MESSAGE, NEW_MESSAGE_NOTIFICATION_QAPP, NEW_MESSAGE_NOTIFICATION_QAPP_LOCAL} from './types'
|
||||||
import { newMessage, newMessageNotificationQapp, newMessageNotificationQappLocal } from './notification-actions'
|
import {newMessage, newMessageNotificationQapp, newMessageNotificationQappLocal} from './notification-actions'
|
||||||
|
|
||||||
export const dispatcher = function (notificationState) {
|
export const dispatcher = function (notificationState) {
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { store } from '../../store.js'
|
import {store} from '../../store.js'
|
||||||
import { doPageUrl, setNewTab } from '../../redux/app/app-actions.js'
|
import {doPageUrl, setNewTab} from '../../redux/app/app-actions.js'
|
||||||
import isElectron from 'is-electron'
|
import isElectron from 'is-electron'
|
||||||
import ShortUniqueId from 'short-unique-id';
|
import ShortUniqueId from 'short-unique-id';
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { store } from './store.js'
|
import {store} from './store.js'
|
||||||
import { saveStateToLocalStorage } from './localStorageHelpers.js'
|
import {saveStateToLocalStorage} from './localStorageHelpers.js'
|
||||||
|
|
||||||
const keys = [
|
const keys = [
|
||||||
'config',
|
'config',
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { routes } from './routes.js'
|
import {routes} from './routes.js'
|
||||||
|
|
||||||
export const addPluginRoutes = epmlInstance => {
|
export const addPluginRoutes = epmlInstance => {
|
||||||
Object.entries(routes).forEach(([route, handler]) => {
|
Object.entries(routes).forEach(([route, handler]) => {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { store } from '../store.js'
|
import {store} from '../store.js'
|
||||||
import { Epml } from '../epml.js'
|
import {Epml} from '../epml.js'
|
||||||
import { addPluginRoutes } from './addPluginRoutes'
|
import {addPluginRoutes} from './addPluginRoutes'
|
||||||
import { doAddPlugin } from '../redux/app/app-actions.js'
|
import {doAddPlugin} from '../redux/app/app-actions.js'
|
||||||
|
|
||||||
let retryLoadPluginsInterval = 0
|
let retryLoadPluginsInterval = 0
|
||||||
export const loadPlugins = () => fetch('/getPlugins')
|
export const loadPlugins = () => fetch('/getPlugins')
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
'use strict'
|
'use strict'
|
||||||
import { Epml, EpmlStream } from '../epml.js'
|
import {Epml, EpmlStream} from '../epml.js'
|
||||||
|
|
||||||
window.Epml = Epml
|
window.Epml = Epml
|
||||||
window.EpmlStream = EpmlStream
|
window.EpmlStream = EpmlStream
|
||||||
|
@ -1,22 +1,19 @@
|
|||||||
import { store } from '../store.js'
|
import {store} from '../store.js'
|
||||||
import {
|
import {
|
||||||
doAddPluginUrl,
|
doAddPluginUrl,
|
||||||
doUpdateBlockInfo,
|
|
||||||
doUpdateNodeStatus,
|
|
||||||
doUpdateNodeInfo,
|
|
||||||
doSetNode,
|
|
||||||
doPageUrl,
|
doPageUrl,
|
||||||
doSetChatHeads,
|
doSetChatHeads,
|
||||||
|
doSetNode,
|
||||||
doUpdateAccountInfo,
|
doUpdateAccountInfo,
|
||||||
|
doUpdateBlockInfo,
|
||||||
|
doUpdateNodeInfo,
|
||||||
|
doUpdateNodeStatus,
|
||||||
} from '../redux/app/app-actions.js'
|
} from '../redux/app/app-actions.js'
|
||||||
import * as api from 'qortal-ui-crypto'
|
import * as api from 'qortal-ui-crypto'
|
||||||
import { requestTransactionDialog } from '../functional-components/confirm-transaction-dialog.js'
|
import {requestTransactionDialog} from '../functional-components/confirm-transaction-dialog.js'
|
||||||
import { doNewMessage } from '../notifications/controller.js'
|
import {doNewMessage} from '../notifications/controller.js'
|
||||||
import snackbar from '../functional-components/snackbar.js'
|
import snackbar from '../functional-components/snackbar.js'
|
||||||
import {
|
import {loadStateFromLocalStorage, saveStateToLocalStorage,} from '../localStorageHelpers.js'
|
||||||
loadStateFromLocalStorage,
|
|
||||||
saveStateToLocalStorage,
|
|
||||||
} from '../localStorageHelpers.js'
|
|
||||||
|
|
||||||
const createTransaction = api.createTransaction
|
const createTransaction = api.createTransaction
|
||||||
const processTransaction = api.processTransaction
|
const processTransaction = api.processTransaction
|
||||||
@ -128,13 +125,13 @@ export const routes = {
|
|||||||
if(!req.data.apiVersion){
|
if(!req.data.apiVersion){
|
||||||
res = await processTransaction(tx.signedBytes)
|
res = await processTransaction(tx.signedBytes)
|
||||||
}
|
}
|
||||||
|
|
||||||
let extraData = {}
|
let extraData = {}
|
||||||
if(req.data.type === 38 && tx && tx._rewardShareKeyPair && tx._rewardShareKeyPair.secretKey){
|
if(req.data.type === 38 && tx && tx._rewardShareKeyPair && tx._rewardShareKeyPair.secretKey){
|
||||||
extraData.rewardSharePrivateKey = Base58.encode(tx._rewardShareKeyPair.secretKey)
|
extraData.rewardSharePrivateKey = Base58.encode(tx._rewardShareKeyPair.secretKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
response = {
|
response = {
|
||||||
success: true,
|
success: true,
|
||||||
data: res,
|
data: res,
|
||||||
@ -182,8 +179,8 @@ export const routes = {
|
|||||||
if(!req.data.apiVersion){
|
if(!req.data.apiVersion){
|
||||||
res = await processTransaction(tx.signedBytes)
|
res = await processTransaction(tx.signedBytes)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
response = {
|
response = {
|
||||||
success: true,
|
success: true,
|
||||||
data: res,
|
data: res,
|
||||||
@ -234,7 +231,7 @@ export const routes = {
|
|||||||
req.data.chatNonce,
|
req.data.chatNonce,
|
||||||
store.getState().app.wallet._addresses[req.data.nonce].keyPair
|
store.getState().app.wallet._addresses[req.data.nonce].keyPair
|
||||||
)
|
)
|
||||||
|
|
||||||
let res
|
let res
|
||||||
|
|
||||||
if(req.data.apiVersion && req.data.apiVersion === 2){
|
if(req.data.apiVersion && req.data.apiVersion === 2){
|
||||||
@ -243,7 +240,7 @@ export const routes = {
|
|||||||
if(!req.data.apiVersion){
|
if(!req.data.apiVersion){
|
||||||
res = await processTransaction(signedChatBytes)
|
res = await processTransaction(signedChatBytes)
|
||||||
}
|
}
|
||||||
|
|
||||||
response = res
|
response = res
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e)
|
console.error(e)
|
||||||
@ -270,7 +267,7 @@ export const routes = {
|
|||||||
if(!req.data.apiVersion){
|
if(!req.data.apiVersion){
|
||||||
res = await processTransaction(signedArbitraryBytes)
|
res = await processTransaction(signedArbitraryBytes)
|
||||||
}
|
}
|
||||||
|
|
||||||
response = res
|
response = res
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e)
|
console.error(e)
|
||||||
@ -296,7 +293,7 @@ export const routes = {
|
|||||||
if(!req.data.apiVersion){
|
if(!req.data.apiVersion){
|
||||||
res = await processTransaction(signedArbitraryBytes)
|
res = await processTransaction(signedArbitraryBytes)
|
||||||
}
|
}
|
||||||
|
|
||||||
response = res
|
response = res
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e)
|
console.error(e)
|
||||||
@ -366,7 +363,7 @@ export const routes = {
|
|||||||
unsignedTxn,
|
unsignedTxn,
|
||||||
store.getState().app.selectedAddress.keyPair
|
store.getState().app.selectedAddress.keyPair
|
||||||
)
|
)
|
||||||
|
|
||||||
let res
|
let res
|
||||||
|
|
||||||
if(req.data.apiVersion && req.data.apiVersion === 2){
|
if(req.data.apiVersion && req.data.apiVersion === 2){
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { store } from '../store.js'
|
import {store} from '../store.js'
|
||||||
import { EpmlStream } from 'epml'
|
import {EpmlStream} from 'epml'
|
||||||
|
|
||||||
const LOGIN_STREAM_NAME = 'logged_in'
|
const LOGIN_STREAM_NAME = 'logged_in'
|
||||||
const CONFIG_STREAM_NAME = 'config'
|
const CONFIG_STREAM_NAME = 'config'
|
||||||
|
@ -1,5 +1,26 @@
|
|||||||
// Core App Actions here...
|
// Core App Actions here...
|
||||||
import { UPDATE_BLOCK_INFO, UPDATE_NODE_STATUS, UPDATE_NODE_INFO, CHAT_HEADS, ACCOUNT_INFO, ADD_AUTO_LOAD_IMAGES_CHAT, REMOVE_AUTO_LOAD_IMAGES_CHAT, ALLOW_QAPP_AUTO_AUTH, REMOVE_QAPP_AUTO_AUTH, SET_CHAT_LAST_SEEN, ADD_CHAT_LAST_SEEN, ALLOW_QAPP_AUTO_LISTS, REMOVE_QAPP_AUTO_LISTS, SET_NEW_TAB, ADD_TAB_INFO, SET_TAB_NOTIFICATIONS, IS_OPEN_DEV_DIALOG, SET_NEW_NOTIFICATION, SET_SIDE_EFFECT, SET_COIN_BALANCES } from '../app-action-types.js'
|
import {
|
||||||
|
ACCOUNT_INFO,
|
||||||
|
ADD_AUTO_LOAD_IMAGES_CHAT,
|
||||||
|
ADD_CHAT_LAST_SEEN,
|
||||||
|
ADD_TAB_INFO,
|
||||||
|
ALLOW_QAPP_AUTO_AUTH,
|
||||||
|
ALLOW_QAPP_AUTO_LISTS,
|
||||||
|
CHAT_HEADS,
|
||||||
|
IS_OPEN_DEV_DIALOG,
|
||||||
|
REMOVE_AUTO_LOAD_IMAGES_CHAT,
|
||||||
|
REMOVE_QAPP_AUTO_AUTH,
|
||||||
|
REMOVE_QAPP_AUTO_LISTS,
|
||||||
|
SET_CHAT_LAST_SEEN,
|
||||||
|
SET_COIN_BALANCES,
|
||||||
|
SET_NEW_NOTIFICATION,
|
||||||
|
SET_NEW_TAB,
|
||||||
|
SET_SIDE_EFFECT,
|
||||||
|
SET_TAB_NOTIFICATIONS,
|
||||||
|
UPDATE_BLOCK_INFO,
|
||||||
|
UPDATE_NODE_INFO,
|
||||||
|
UPDATE_NODE_STATUS
|
||||||
|
} from '../app-action-types.js'
|
||||||
|
|
||||||
export const doUpdateBlockInfo = (blockObj) => {
|
export const doUpdateBlockInfo = (blockObj) => {
|
||||||
return (dispatch, getState) => {
|
return (dispatch, getState) => {
|
||||||
@ -164,4 +185,4 @@ export const setCoinBalances = (payload)=> {
|
|||||||
type: SET_COIN_BALANCES,
|
type: SET_COIN_BALANCES,
|
||||||
payload
|
payload
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import { Epml } from '../../../epml.js'
|
import {Epml} from '../../../epml.js'
|
||||||
import { EpmlWorkerPlugin } from 'epml'
|
import {EpmlWorkerPlugin} from 'epml'
|
||||||
|
|
||||||
|
import {INIT_WORKERS} from '../app-action-types.js'
|
||||||
|
|
||||||
import { INIT_WORKERS } from '../app-action-types.js'
|
|
||||||
Epml.registerPlugin(EpmlWorkerPlugin)
|
Epml.registerPlugin(EpmlWorkerPlugin)
|
||||||
|
|
||||||
export const doInitWorkers = (numberOfWorkers, workerURL) => {
|
export const doInitWorkers = (numberOfWorkers, workerURL) => {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { LOG_IN, LOG_OUT, SELECT_ADDRESS } from '../app-action-types.js'
|
import {LOG_IN, LOG_OUT, SELECT_ADDRESS} from '../app-action-types.js'
|
||||||
|
|
||||||
export const doSelectAddress = address => {
|
export const doSelectAddress = address => {
|
||||||
return (dispatch, getState) => {
|
return (dispatch, getState) => {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// Node Config Actions here...
|
// Node Config Actions here...
|
||||||
import { LOAD_NODE_CONFIG, SET_NODE, ADD_NODE, REMOVE_NODE, EDIT_NODE } from '../app-action-types.js'
|
import {ADD_NODE, EDIT_NODE, LOAD_NODE_CONFIG, REMOVE_NODE, SET_NODE} from '../app-action-types.js'
|
||||||
import { UI_VERSION } from '../version.js'
|
import {UI_VERSION} from '../version.js'
|
||||||
|
|
||||||
const nodeConfigUrl = '/getConfig'
|
const nodeConfigUrl = '/getConfig'
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { ADD_PLUGIN, ADD_PLUGIN_URL, PAGE_URL } from '../app-action-types.js'
|
import {ADD_PLUGIN, ADD_PLUGIN_URL, PAGE_URL} from '../app-action-types.js'
|
||||||
|
|
||||||
export const doAddPluginUrl = (pluginUrlsConf) => {
|
export const doAddPluginUrl = (pluginUrlsConf) => {
|
||||||
return (dispatch, getState) => {
|
return (dispatch, getState) => {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { NAVIGATE, NETWORK_CONNECTION_STATUS } from './app-action-types.js'
|
import {NAVIGATE, NETWORK_CONNECTION_STATUS} from './app-action-types.js'
|
||||||
|
|
||||||
export * from './actions/login.js'
|
export * from './actions/login.js'
|
||||||
export * from './actions/init-worker.js'
|
export * from './actions/init-worker.js'
|
||||||
|
@ -1,10 +1,47 @@
|
|||||||
// Loading state, login state, isNavDrawOpen state etc. None of this needs to be saved to localstorage.
|
// Loading state, login state, isNavDrawOpen state etc. None of this needs to be saved to localstorage.
|
||||||
import { loadStateFromLocalStorage, saveStateToLocalStorage } from '../../localStorageHelpers.js'
|
import {loadStateFromLocalStorage, saveStateToLocalStorage} from '../../localStorageHelpers.js'
|
||||||
import { LOG_IN, LOG_OUT, NETWORK_CONNECTION_STATUS, INIT_WORKERS, ADD_PLUGIN_URL, ADD_PLUGIN, ADD_NEW_PLUGIN_URL, NAVIGATE, SELECT_ADDRESS, ACCOUNT_INFO, CHAT_HEADS, UPDATE_BLOCK_INFO, UPDATE_NODE_STATUS, UPDATE_NODE_INFO, LOAD_NODE_CONFIG, SET_NODE, ADD_NODE, PAGE_URL, ADD_AUTO_LOAD_IMAGES_CHAT, REMOVE_AUTO_LOAD_IMAGES_CHAT, ALLOW_QAPP_AUTO_AUTH, REMOVE_QAPP_AUTO_AUTH, SET_CHAT_LAST_SEEN, ADD_CHAT_LAST_SEEN, ALLOW_QAPP_AUTO_LISTS, REMOVE_QAPP_AUTO_LISTS, SET_NEW_TAB, ADD_TAB_INFO, SET_TAB_NOTIFICATIONS, IS_OPEN_DEV_DIALOG, REMOVE_NODE, EDIT_NODE, SET_NEW_NOTIFICATION, SET_SIDE_EFFECT, SET_COIN_BALANCES } from './app-action-types.js'
|
import {
|
||||||
import { initWorkersReducer } from './reducers/init-workers.js'
|
ACCOUNT_INFO,
|
||||||
import { loginReducer } from './reducers/login-reducer.js'
|
ADD_AUTO_LOAD_IMAGES_CHAT,
|
||||||
import { setNode, addNode, removeNode, editNode } from './reducers/manage-node.js'
|
ADD_CHAT_LAST_SEEN,
|
||||||
|
ADD_NEW_PLUGIN_URL,
|
||||||
|
ADD_NODE,
|
||||||
|
ADD_PLUGIN,
|
||||||
|
ADD_PLUGIN_URL,
|
||||||
|
ADD_TAB_INFO,
|
||||||
|
ALLOW_QAPP_AUTO_AUTH,
|
||||||
|
ALLOW_QAPP_AUTO_LISTS,
|
||||||
|
CHAT_HEADS,
|
||||||
|
EDIT_NODE,
|
||||||
|
INIT_WORKERS,
|
||||||
|
IS_OPEN_DEV_DIALOG,
|
||||||
|
LOAD_NODE_CONFIG,
|
||||||
|
LOG_IN,
|
||||||
|
LOG_OUT,
|
||||||
|
NAVIGATE,
|
||||||
|
NETWORK_CONNECTION_STATUS,
|
||||||
|
PAGE_URL,
|
||||||
|
REMOVE_AUTO_LOAD_IMAGES_CHAT,
|
||||||
|
REMOVE_NODE,
|
||||||
|
REMOVE_QAPP_AUTO_AUTH,
|
||||||
|
REMOVE_QAPP_AUTO_LISTS,
|
||||||
|
SELECT_ADDRESS,
|
||||||
|
SET_CHAT_LAST_SEEN,
|
||||||
|
SET_COIN_BALANCES,
|
||||||
|
SET_NEW_NOTIFICATION,
|
||||||
|
SET_NEW_TAB,
|
||||||
|
SET_NODE,
|
||||||
|
SET_SIDE_EFFECT,
|
||||||
|
SET_TAB_NOTIFICATIONS,
|
||||||
|
UPDATE_BLOCK_INFO,
|
||||||
|
UPDATE_NODE_INFO,
|
||||||
|
UPDATE_NODE_STATUS
|
||||||
|
} from './app-action-types.js'
|
||||||
|
import {initWorkersReducer} from './reducers/init-workers.js'
|
||||||
|
import {loginReducer} from './reducers/login-reducer.js'
|
||||||
|
import {addNode, editNode, removeNode, setNode} from './reducers/manage-node.js'
|
||||||
import localForage from "localforage";
|
import localForage from "localforage";
|
||||||
|
|
||||||
const chatLastSeen = localForage.createInstance({
|
const chatLastSeen = localForage.createInstance({
|
||||||
name: "chat-last-seen",
|
name: "chat-last-seen",
|
||||||
});
|
});
|
||||||
@ -71,7 +108,7 @@ export default (state = INITIAL_STATE, action) => {
|
|||||||
wallet: INITIAL_STATE.wallet,
|
wallet: INITIAL_STATE.wallet,
|
||||||
selectedAddress: INITIAL_STATE.selectedAddress,
|
selectedAddress: INITIAL_STATE.selectedAddress,
|
||||||
accountInfo: INITIAL_STATE.accountInfo
|
accountInfo: INITIAL_STATE.accountInfo
|
||||||
|
|
||||||
}
|
}
|
||||||
case ADD_PLUGIN:
|
case ADD_PLUGIN:
|
||||||
return {
|
return {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
// Must be saved to localstorage. Will storage things such as saved addresses and themes (day/night mode) etc.
|
// Must be saved to localstorage. Will storage things such as saved addresses and themes (day/night mode) etc.
|
||||||
// Initial state needs to be loaded from either the getConfig url or localstorage...NOT set via this
|
// Initial state needs to be loaded from either the getConfig url or localstorage...NOT set via this
|
||||||
import { loadStateFromLocalStorage } from '../../localStorageHelpers'
|
import {loadStateFromLocalStorage} from '../../localStorageHelpers'
|
||||||
import { LOAD_CONFIG_FROM_API } from './config-actions.js'
|
import {LOAD_CONFIG_FROM_API} from './config-actions.js'
|
||||||
import { loadConfigFromAPI } from './reducers/load-config-from-api.js'
|
import {loadConfigFromAPI} from './reducers/load-config-from-api.js'
|
||||||
|
|
||||||
const DEFAULT_INITIAL_STATE = {
|
const DEFAULT_INITIAL_STATE = {
|
||||||
styles: {
|
styles: {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { combineReducers } from 'redux'
|
import {combineReducers} from 'redux'
|
||||||
|
|
||||||
import app from './app/app-reducer.js'
|
import app from './app/app-reducer.js'
|
||||||
import config from './config/config-reducer.js'
|
import config from './config/config-reducer.js'
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { CLAIM_AIRDROP } from '../user-action-types.js'
|
import {CLAIM_AIRDROP} from '../user-action-types.js'
|
||||||
|
|
||||||
export const doClaimAirdrop = (address) => {
|
export const doClaimAirdrop = (address) => {
|
||||||
return (dispatch, getState) => {
|
return (dispatch, getState) => {
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
|
import {LOAD_NOTIFICATION_CONFIG, SET_QCHAT_NOTIFICATION_CONFIG} from '../user-action-types.js'
|
||||||
import { LOAD_NOTIFICATION_CONFIG, SET_QCHAT_NOTIFICATION_CONFIG } from '../user-action-types.js'
|
|
||||||
|
|
||||||
const configUrl = '/getConfig'
|
const configUrl = '/getConfig'
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { STORE_WALLET, REMOVE_WALLET, UPDATE_STORED_WALLET_NAME } from '../user-action-types.js'
|
import {REMOVE_WALLET, STORE_WALLET, UPDATE_STORED_WALLET_NAME} from '../user-action-types.js'
|
||||||
|
|
||||||
export const doStoreWallet = (wallet, password, name, statusUpdateFn = () => { }) => {
|
export const doStoreWallet = (wallet, password, name, statusUpdateFn = () => { }) => {
|
||||||
return (dispatch, getState) => {
|
return (dispatch, getState) => {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { UPDATE_ACCOUNT_INFO } from '../user-action-types'
|
import {UPDATE_ACCOUNT_INFO} from '../user-action-types'
|
||||||
|
|
||||||
export const doUpdateAccountInfo = (accInfo) => {
|
export const doUpdateAccountInfo = (accInfo) => {
|
||||||
return (dispatch, getState) => {
|
return (dispatch, getState) => {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { updateAccountInfo } from './update-account-info.js'
|
import {updateAccountInfo} from './update-account-info.js'
|
||||||
import { doUpdateStoredWalletName } from './store-wallet.js'
|
import {doUpdateStoredWalletName} from './store-wallet.js'
|
||||||
|
|
||||||
const GET_NAME_URL = 'names/address/'
|
const GET_NAME_URL = 'names/address/'
|
||||||
const CHECK_NAME_INTERVAL = 1000 * 10 // Every 10 seconds
|
const CHECK_NAME_INTERVAL = 1000 * 10 // Every 10 seconds
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
import { loadStateFromLocalStorage } from '../../localStorageHelpers'
|
import {loadStateFromLocalStorage} from '../../localStorageHelpers'
|
||||||
import { STORE_WALLET, REMOVE_WALLET, CLAIM_AIRDROP, UPDATE_ACCOUNT_INFO, LOAD_NOTIFICATION_CONFIG, SET_QCHAT_NOTIFICATION_CONFIG } from './user-action-types.js'
|
import {
|
||||||
|
CLAIM_AIRDROP,
|
||||||
|
LOAD_NOTIFICATION_CONFIG,
|
||||||
|
REMOVE_WALLET,
|
||||||
|
SET_QCHAT_NOTIFICATION_CONFIG,
|
||||||
|
STORE_WALLET,
|
||||||
|
UPDATE_ACCOUNT_INFO
|
||||||
|
} from './user-action-types.js'
|
||||||
|
|
||||||
const DEFAULT_INITIAL_STATE = {
|
const DEFAULT_INITIAL_STATE = {
|
||||||
storedWallets: {},
|
storedWallets: {},
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* Simple helper function so that I can do `await stateAwait(state => state.something === true)` or `await stateAwait(state => state.name === 'myName')`
|
* Simple helper function so that I can do `await stateAwait(state => state.something === true)` or `await stateAwait(state => state.name === 'myName')`
|
||||||
*/
|
*/
|
||||||
import { store } from './store.js'
|
import {store} from './store.js'
|
||||||
|
|
||||||
let subscriptions = []
|
let subscriptions = []
|
||||||
store.subscribe(() => {
|
store.subscribe(() => {
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import { createStore, compose, applyMiddleware } from 'redux'
|
import {applyMiddleware, compose, createStore} from 'redux'
|
||||||
import thunk from 'redux-thunk'
|
import thunk from 'redux-thunk'
|
||||||
|
|
||||||
import reducers from './redux/reducers.js'
|
import reducers from './redux/reducers.js'
|
||||||
|
|
||||||
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose
|
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose
|
||||||
|
|
||||||
export const store = createStore(
|
export const store = createStore(
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { LitElement, html } from 'lit'
|
import {html, LitElement} from 'lit'
|
||||||
|
|
||||||
import './styles.scss'
|
import './styles.scss'
|
||||||
import './app-theme.js'
|
import './app-theme.js'
|
||||||
@ -21,7 +21,7 @@ class AppStyles extends LitElement {
|
|||||||
--shadow-4: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
|
--shadow-4: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
|
||||||
--shadow-5: 0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22);
|
--shadow-5: 0 19px 38px rgba(0,0,0,0.30), 0 15px 12px rgba(0,0,0,0.22);
|
||||||
--paper-input-container-focus-color: var(--mdc-theme-secondary);
|
--paper-input-container-focus-color: var(--mdc-theme-secondary);
|
||||||
|
|
||||||
font-family: "Roboto", sans-serif;
|
font-family: "Roboto", sans-serif;
|
||||||
color: var(--mdc-theme-on-surface);
|
color: var(--mdc-theme-on-surface);
|
||||||
--window-height: ${this.windowHeight};
|
--window-height: ${this.windowHeight};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { LitElement, html } from 'lit'
|
import {html, LitElement} from 'lit'
|
||||||
import { connect } from 'pwa-helpers'
|
import {connect} from 'pwa-helpers'
|
||||||
import { store } from '../store.js'
|
import {store} from '../store.js'
|
||||||
|
|
||||||
class AppTheme extends connect(store)(LitElement) {
|
class AppTheme extends connect(store)(LitElement) {
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ class AppTheme extends connect(store)(LitElement) {
|
|||||||
--mdc-theme-secondary: ${this.theme.colors.secondary}; /* Sets the text color to the theme secondary color. */
|
--mdc-theme-secondary: ${this.theme.colors.secondary}; /* Sets the text color to the theme secondary color. */
|
||||||
--mdc-theme-secondary-bg: ${this.theme.colors.secondaryBg};/* Sets the background color to the theme secondary color. */
|
--mdc-theme-secondary-bg: ${this.theme.colors.secondaryBg};/* Sets the background color to the theme secondary color. */
|
||||||
--mdc-theme-on-secondary: ${this.theme.colors.onSecondary}; /* Sets the text color to the color configured for text on the secondary color. */
|
--mdc-theme-on-secondary: ${this.theme.colors.onSecondary}; /* Sets the text color to the color configured for text on the secondary color. */
|
||||||
|
|
||||||
--mdc-theme-surface: ${this.theme.colors.surface}; /* Sets the background color to the surface background color. */
|
--mdc-theme-surface: ${this.theme.colors.surface}; /* Sets the background color to the surface background color. */
|
||||||
--mdc-theme-on-surface: ${this.theme.colors.onSurface};/* Sets the text color to the color configured for text on the surface color. */
|
--mdc-theme-on-surface: ${this.theme.colors.onSurface};/* Sets the text color to the color configured for text on the surface color. */
|
||||||
--mdc-theme-background: ${this.theme.colors.background};/* Sets the background color to the theme background color. */
|
--mdc-theme-background: ${this.theme.colors.background};/* Sets the background color to the theme background color. */
|
||||||
@ -43,7 +43,7 @@ class AppTheme extends connect(store)(LitElement) {
|
|||||||
paper-spinner-lite, paper-spinner {
|
paper-spinner-lite, paper-spinner {
|
||||||
--paper-spinner-color: var(--mdc-theme-secondary)
|
--paper-spinner-color: var(--mdc-theme-secondary)
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
`
|
`
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { routes } from './trade-bot-routes.js'
|
import {routes} from './trade-bot-routes.js'
|
||||||
|
|
||||||
export const addTradeBotRoutes = epmlInstance => {
|
export const addTradeBotRoutes = epmlInstance => {
|
||||||
Object.entries(routes).forEach(([route, handler]) => {
|
Object.entries(routes).forEach(([route, handler]) => {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { store } from '../store.js'
|
import {store} from '../store.js'
|
||||||
import * as api from 'qortal-ui-crypto'
|
import * as api from 'qortal-ui-crypto'
|
||||||
import snackbar from '../functional-components/snackbar.js'
|
import snackbar from '../functional-components/snackbar.js'
|
||||||
|
|
||||||
@ -35,14 +35,14 @@ export const routes = {
|
|||||||
if (!req.disableModal && !req.data.disableModal) {
|
if (!req.disableModal && !req.data.disableModal) {
|
||||||
await requestTransactionDialog.requestTransaction(tx)
|
await requestTransactionDialog.requestTransaction(tx)
|
||||||
}
|
}
|
||||||
|
|
||||||
const res = await processTransaction(tx.signedBytes)
|
const res = await processTransaction(tx.signedBytes)
|
||||||
let extraData = {}
|
let extraData = {}
|
||||||
if(req.data.type === 38 && tx && tx._rewardShareKeyPair && tx._rewardShareKeyPair.secretKey){
|
if(req.data.type === 38 && tx && tx._rewardShareKeyPair && tx._rewardShareKeyPair.secretKey){
|
||||||
extraData.rewardSharePrivateKey = Base58.encode(tx._rewardShareKeyPair.secretKey)
|
extraData.rewardSharePrivateKey = Base58.encode(tx._rewardShareKeyPair.secretKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
response = {
|
response = {
|
||||||
success: true,
|
success: true,
|
||||||
data: res,
|
data: res,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { Epml, EpmlReadyPlugin, RequestPlugin, EpmlWorkerPlugin } from 'epml'
|
import {Epml, EpmlReadyPlugin, EpmlWorkerPlugin, RequestPlugin} from 'epml'
|
||||||
|
|
||||||
import utils from './cryptoUtils.js'
|
import utils from './cryptoUtils.js'
|
||||||
import { Sha512, bytes_to_base64 as bytesToBase64 } from 'asmcrypto.js'
|
import {bytes_to_base64 as bytesToBase64, Sha512} from 'asmcrypto.js'
|
||||||
import bcrypt from 'bcryptjs'
|
import bcrypt from 'bcryptjs'
|
||||||
|
|
||||||
Epml.registerPlugin(RequestPlugin)
|
Epml.registerPlugin(RequestPlugin)
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import { Sha256 } from 'asmcrypto.js'
|
import {Sha256} from 'asmcrypto.js'
|
||||||
import Base58 from './api/deps/Base58'
|
import Base58 from './api/deps/Base58'
|
||||||
import Base64 from './api/deps/Base64'
|
import Base64 from './api/deps/Base64'
|
||||||
import { base58PublicKeyToAddress } from './api/wallet/base58PublicKeyToAddress'
|
import {base58PublicKeyToAddress} from './api/wallet/base58PublicKeyToAddress'
|
||||||
import { validateAddress } from './api/wallet/validateAddress'
|
import {validateAddress} from './api/wallet/validateAddress'
|
||||||
import { decryptChatMessage, decryptChatMessageBase64 } from './api/transactions/chat/decryptChatMessage'
|
import {decryptChatMessage, decryptChatMessageBase64} from './api/transactions/chat/decryptChatMessage'
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
|
|
||||||
window.Sha256 = Sha256
|
window.Sha256 = Sha256
|
||||||
|
@ -3,11 +3,11 @@ Copyright 2017-2018 @ irontiga and vbcs (original developer)
|
|||||||
*/
|
*/
|
||||||
'use strict'
|
'use strict'
|
||||||
import Base58 from './deps/Base58.js'
|
import Base58 from './deps/Base58.js'
|
||||||
import { Sha256, Sha512 } from 'asmcrypto.js'
|
import {Sha256, Sha512} from 'asmcrypto.js'
|
||||||
import nacl from './deps/nacl-fast.js'
|
import nacl from './deps/nacl-fast.js'
|
||||||
import utils from './deps/utils.js'
|
import utils from './deps/utils.js'
|
||||||
|
|
||||||
import { generateSaveWalletData } from './storeWallet.js'
|
import {generateSaveWalletData} from './storeWallet.js'
|
||||||
|
|
||||||
import publicKeyToAddress from './wallet/publicKeyToAddress.js'
|
import publicKeyToAddress from './wallet/publicKeyToAddress.js'
|
||||||
import AltcoinHDWallet from "./bitcoin/AltcoinHDWallet"
|
import AltcoinHDWallet from "./bitcoin/AltcoinHDWallet"
|
||||||
@ -93,7 +93,7 @@ export default class PhraseWallet {
|
|||||||
const address = publicKeyToAddress(addrKeyPair.publicKey);
|
const address = publicKeyToAddress(addrKeyPair.publicKey);
|
||||||
const qoraAddress = publicKeyToAddress(addrKeyPair.publicKey, true);
|
const qoraAddress = publicKeyToAddress(addrKeyPair.publicKey, true);
|
||||||
|
|
||||||
// Create Bitcoin HD Wallet
|
// Create Bitcoin HD Wallet
|
||||||
const btcSeed = [...addrSeed];
|
const btcSeed = [...addrSeed];
|
||||||
const btcWallet = new AltcoinHDWallet({
|
const btcWallet = new AltcoinHDWallet({
|
||||||
mainnet: {
|
mainnet: {
|
||||||
@ -108,7 +108,7 @@ export default class PhraseWallet {
|
|||||||
}
|
}
|
||||||
}).createWallet(new Uint8Array(btcSeed), false);
|
}).createWallet(new Uint8Array(btcSeed), false);
|
||||||
|
|
||||||
// Create Litecoin HD Wallet
|
// Create Litecoin HD Wallet
|
||||||
const ltcSeed = [...addrSeed];
|
const ltcSeed = [...addrSeed];
|
||||||
const ltcWallet = new AltcoinHDWallet({
|
const ltcWallet = new AltcoinHDWallet({
|
||||||
mainnet: {
|
mainnet: {
|
||||||
@ -123,7 +123,7 @@ export default class PhraseWallet {
|
|||||||
}
|
}
|
||||||
}).createWallet(new Uint8Array(ltcSeed), false, 'LTC');
|
}).createWallet(new Uint8Array(ltcSeed), false, 'LTC');
|
||||||
|
|
||||||
// Create Dogecoin HD Wallet
|
// Create Dogecoin HD Wallet
|
||||||
const dogeSeed = [...addrSeed];
|
const dogeSeed = [...addrSeed];
|
||||||
const dogeWallet = new AltcoinHDWallet({
|
const dogeWallet = new AltcoinHDWallet({
|
||||||
mainnet: {
|
mainnet: {
|
||||||
@ -138,7 +138,7 @@ export default class PhraseWallet {
|
|||||||
}
|
}
|
||||||
}).createWallet(new Uint8Array(dogeSeed), false, 'DOGE');
|
}).createWallet(new Uint8Array(dogeSeed), false, 'DOGE');
|
||||||
|
|
||||||
// Create Digibyte HD Wallet
|
// Create Digibyte HD Wallet
|
||||||
const dgbSeed = [...addrSeed];
|
const dgbSeed = [...addrSeed];
|
||||||
const dgbWallet = new AltcoinHDWallet({
|
const dgbWallet = new AltcoinHDWallet({
|
||||||
mainnet: {
|
mainnet: {
|
||||||
@ -153,7 +153,7 @@ export default class PhraseWallet {
|
|||||||
}
|
}
|
||||||
}).createWallet(new Uint8Array(dgbSeed), false, 'DGB');
|
}).createWallet(new Uint8Array(dgbSeed), false, 'DGB');
|
||||||
|
|
||||||
// Create Ravencoin HD Wallet
|
// Create Ravencoin HD Wallet
|
||||||
const rvnSeed = [...addrSeed];
|
const rvnSeed = [...addrSeed];
|
||||||
const rvnWallet = new AltcoinHDWallet({
|
const rvnWallet = new AltcoinHDWallet({
|
||||||
mainnet: {
|
mainnet: {
|
||||||
@ -168,7 +168,7 @@ export default class PhraseWallet {
|
|||||||
}
|
}
|
||||||
}).createWallet(new Uint8Array(rvnSeed), false, 'RVN');
|
}).createWallet(new Uint8Array(rvnSeed), false, 'RVN');
|
||||||
|
|
||||||
// Create Pirate Chain HD Wallet
|
// Create Pirate Chain HD Wallet
|
||||||
const arrrSeed = [...addrSeed];
|
const arrrSeed = [...addrSeed];
|
||||||
const arrrWallet = new AltcoinHDWallet({
|
const arrrWallet = new AltcoinHDWallet({
|
||||||
mainnet: {
|
mainnet: {
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import Base58 from '../deps/Base58.js'
|
import Base58 from '../deps/Base58.js'
|
||||||
import { Sha256, Sha512 } from 'asmcrypto.js'
|
import {Sha256, Sha512} from 'asmcrypto.js'
|
||||||
import jsSHA from 'jssha'
|
import jsSHA from 'jssha'
|
||||||
import RIPEMD160 from '../deps/ripemd160.js'
|
import RIPEMD160 from '../deps/ripemd160.js'
|
||||||
import utils from '../deps/utils.js'
|
import utils from '../deps/utils.js'
|
||||||
import { EllipticCurve, BigInteger } from './ecbn.js'
|
import {BigInteger, EllipticCurve} from './ecbn.js'
|
||||||
|
|
||||||
export default class AltcoinHDWallet {
|
export default class AltcoinHDWallet {
|
||||||
|
|
||||||
@ -335,7 +335,7 @@ export default class AltcoinHDWallet {
|
|||||||
// Append 1 byte '0x00' (to make the key data 33 bytes, DO THIS ONLY FOR PRIVATE KEYS )
|
// Append 1 byte '0x00' (to make the key data 33 bytes, DO THIS ONLY FOR PRIVATE KEYS )
|
||||||
s.push(0)
|
s.push(0)
|
||||||
|
|
||||||
//if the private key length is less than 32 let's add leading zeros
|
//if the private key length is less than 32 let's add leading zeros
|
||||||
if(this.privateKey.length<32){
|
if(this.privateKey.length<32){
|
||||||
for(let i=this.privateKey.length;i<32;i++){
|
for(let i=this.privateKey.length;i<32;i++){
|
||||||
s.push(0)
|
s.push(0)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { transactionTypes as transactions } from './transactions/transactions.js'
|
import {transactionTypes as transactions} from './transactions/transactions.js'
|
||||||
import Base58 from './deps/Base58.js'
|
import Base58 from './deps/Base58.js'
|
||||||
import { request } from './fetch-request'
|
import {request} from './fetch-request'
|
||||||
import signChat from './transactions/chat/signChat.js'
|
import signChat from './transactions/chat/signChat.js'
|
||||||
import signArbitrary from './transactions/arbitrary/signArbitrary.js'
|
import signArbitrary from './transactions/arbitrary/signArbitrary.js'
|
||||||
import signArbitraryWithFee from './transactions/arbitrary/signArbitraryWithFee.js'
|
import signArbitraryWithFee from './transactions/arbitrary/signArbitraryWithFee.js'
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { kdf } from './kdf.js'
|
import {kdf} from './kdf.js'
|
||||||
import PhraseWallet from './PhraseWallet.js'
|
import PhraseWallet from './PhraseWallet.js'
|
||||||
import Base58 from './deps/Base58.js'
|
import Base58 from './deps/Base58.js'
|
||||||
import { decryptStoredWallet } from './decryptStoredWallet.js'
|
import {decryptStoredWallet} from './decryptStoredWallet.js'
|
||||||
|
|
||||||
export const createWallet = async (sourceType, source, statusUpdateFn) => {
|
export const createWallet = async (sourceType, source, statusUpdateFn) => {
|
||||||
let version, seed
|
let version, seed
|
||||||
|
@ -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 { HmacSha512, AES_CBC } from 'asmcrypto.js'
|
import {AES_CBC, HmacSha512} from 'asmcrypto.js'
|
||||||
import { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from 'lit-translate'
|
import {get, registerTranslateConfig} from 'lit-translate'
|
||||||
|
|
||||||
registerTranslateConfig({
|
registerTranslateConfig({
|
||||||
loader: lang => fetch(`/language/${lang}.json`).then(res => res.json())
|
loader: lang => fetch(`/language/${lang}.json`).then(res => res.json())
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { watchConfig, waitForConfig } from '../config.js'
|
import {waitForConfig, watchConfig} from '../config.js'
|
||||||
|
|
||||||
let config = {}
|
let config = {}
|
||||||
watchConfig((c) => {
|
watchConfig((c) => {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { store } from '../api_deps.js'
|
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 { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from 'lit-translate'
|
import {get, registerTranslateConfig} from 'lit-translate'
|
||||||
|
|
||||||
registerTranslateConfig({
|
registerTranslateConfig({
|
||||||
loader: lang => fetch(`/language/${lang}.json`).then(res => res.json())
|
loader: lang => fetch(`/language/${lang}.json`).then(res => res.json())
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* Not to be confused with register name...this is a special use case
|
* Not to be confused with register name...this is a special use case
|
||||||
*/
|
*/
|
||||||
import { request, createTransaction, processTransaction } from './api.js'
|
import {createTransaction, processTransaction, request} from './api.js'
|
||||||
|
|
||||||
const TX_TYPE = 3 // NAME_REGISTRATION
|
const TX_TYPE = 3 // NAME_REGISTRATION
|
||||||
const CHECK_LAST_REF_INTERVAL = 30 * 1000 // err 30 seconds
|
const CHECK_LAST_REF_INTERVAL = 30 * 1000 // err 30 seconds
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { HmacSha512, AES_CBC } from 'asmcrypto.js'
|
import {AES_CBC, HmacSha512} from 'asmcrypto.js'
|
||||||
import { kdf } from './kdf.js'
|
import {kdf} from './kdf.js'
|
||||||
import Base58 from './deps/Base58.js'
|
import Base58 from './deps/Base58.js'
|
||||||
|
|
||||||
const getRandomValues = window.crypto ? window.crypto.getRandomValues.bind(window.crypto) : window.msCrypto.getRandomValues.bind(window.msCrypto)
|
const getRandomValues = window.crypto ? window.crypto.getRandomValues.bind(window.crypto) : window.msCrypto.getRandomValues.bind(window.msCrypto)
|
||||||
|
@ -3,7 +3,7 @@ import TradeBotCreateRequest from './transactions/trade-portal/tradebot/TradeBot
|
|||||||
import TradeBotRespondRequest from './transactions/trade-portal/tradebot/TradeBotRespondRequest.js'
|
import TradeBotRespondRequest from './transactions/trade-portal/tradebot/TradeBotRespondRequest.js'
|
||||||
import signTradeBotTransaction from './transactions/trade-portal/tradebot/signTradeBotTransaction.js'
|
import signTradeBotTransaction from './transactions/trade-portal/tradebot/signTradeBotTransaction.js'
|
||||||
import DeleteTradeOffer from './transactions/trade-portal/tradeoffer/DeleteTradeOffer.js'
|
import DeleteTradeOffer from './transactions/trade-portal/tradeoffer/DeleteTradeOffer.js'
|
||||||
import { request } from './fetch-request'
|
import {request} from './fetch-request'
|
||||||
|
|
||||||
// TradeBotCreateRequest
|
// TradeBotCreateRequest
|
||||||
export const tradeBotCreateRequest = (requestObject) => {
|
export const tradeBotCreateRequest = (requestObject) => {
|
||||||
@ -55,7 +55,7 @@ export const deleteTradeOffer = (requestObject) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send BTC
|
// Send BTC
|
||||||
export const sendBtc = (requestObject) => {
|
export const sendBtc = (requestObject) => {
|
||||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ export const sendBtc = (requestObject) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send LTC
|
// Send LTC
|
||||||
export const sendLtc = (requestObject) => {
|
export const sendLtc = (requestObject) => {
|
||||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ export const sendLtc = (requestObject) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send DOGE
|
// Send DOGE
|
||||||
export const sendDoge = (requestObject) => {
|
export const sendDoge = (requestObject) => {
|
||||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||||
|
|
||||||
@ -97,7 +97,7 @@ export const sendDoge = (requestObject) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send DGB
|
// Send DGB
|
||||||
export const sendDgb = (requestObject) => {
|
export const sendDgb = (requestObject) => {
|
||||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||||
|
|
||||||
@ -111,7 +111,7 @@ export const sendDgb = (requestObject) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send RVN
|
// Send RVN
|
||||||
export const sendRvn = (requestObject) => {
|
export const sendRvn = (requestObject) => {
|
||||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||||
|
|
||||||
@ -125,7 +125,7 @@ export const sendRvn = (requestObject) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send ARRR
|
// Send ARRR
|
||||||
export const sendArrr = (requestObject) => {
|
export const sendArrr = (requestObject) => {
|
||||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
'use strict'
|
'use strict'
|
||||||
import TransactionBase from './TransactionBase.js'
|
import TransactionBase from './TransactionBase.js'
|
||||||
import { QORT_DECIMALS } from '../constants.js'
|
import {QORT_DECIMALS} from '../constants.js'
|
||||||
|
|
||||||
export default class PaymentTransaction extends TransactionBase {
|
export default class PaymentTransaction extends TransactionBase {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user