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