4
1
mirror of https://github.com/Qortal/qortal-ui.git synced 2025-02-11 17:55:51 +00:00

Merge branch 'master' into show-groupid

This commit is contained in:
QuickMythril 2024-04-02 19:24:04 -04:00 committed by GitHub
commit 030a0d0080
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
183 changed files with 4456 additions and 5420 deletions

View File

@ -1 +0,0 @@
/node_modules

View File

@ -1,15 +0,0 @@
{
"env": {
"browser": true,
"es2021": true
},
"plugins": ["lit", "wc"],
"extends": ["eslint:recommended", "plugin:lit/recommended", "plugin:wc/recommended"],
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module"
},
"rules": {
"no-mixed-spaces-and-tabs": 0
}
}

View File

@ -1,71 +0,0 @@
branches:
except:
- master
language: node_js
node_js: "14.17.0"
cache:
yarn: true
directories:
- node_modules
# - qortal-ui-core/node_modules
# - qortal-ui-plugins/node_modules
# - qortal-ui-crypto/node_modules
- $HOME/.cache/electron
- $HOME/.cache/electron-builder
install:
- sh install-dependencies.sh
env:
global:
- ELECTRON_CACHE=$HOME/.cache/electron
- ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder
- ELECTRON_ENABLE_LOGGING=true
jobs:
include:
- stage: Deploy Linux
if: tag IS present
os: linux
dist: bionic
sudo: required
addons:
apt:
packages:
# default Electron dependencies
- build-essential
- gconf2
- gconf-service
- libgtk-3-0
- libnotify4
- libxss-dev
- libxss1
- xdg-utils
- libatspi2.0-0
- libappindicator1
- libxext-dev
- libxtst6
- libxtst-dev
- libnss3
script:
- newVersion=$(git describe --abbrev=0)
- yarn version --new-version $newVersion
- sh set-up-snap.sh
- yarn run release
- stage: Deploy Windows & Mac
if: tag IS present
os: osx
osx_image: xcode12.5.1
script:
- newVersion=$(git describe --abbrev=0)
- yarn version --new-version $newVersion
- yarn run release -- --mac --win
before_cache:
- rm -rf $HOME/.cache/electron-builder/wine
# - stage: Update GitHub with Builds
# if: tag IS present
# script:
# - sh push-updates-with-travis-build.sh

View File

@ -26,7 +26,7 @@ Easiest way to install the lastest required packages on Linux is via nvm.
``` source ~/.profile ``` (For Debian based distro) <br/>
``` source ~/.bashrc ``` (For Fedora / CentOS) <br/>
``` nvm ls-remote ``` (Fetch list of available versions) <br/>
``` nvm install v20.9.0 ``` (LTS: Iron supported by Electron) <br/>
``` nvm install v18.17.1 ``` (LTS: Hydrogen supported by Electron V27) <br/>
``` npm --location=global install npm@10.5.0 ``` <br/>
Adding via binary package mirror will only work if you have set the package path. You can do a node or java build via ports instead by downloading ports with portsnap fetch method.

View File

@ -1,23 +0,0 @@
{
"name": "Q-Blog",
"defaultFeedIndex": 0,
"feed": [
{
"id": "post-creation",
"version": 1,
"updated": 1696646223261,
"title": "Q-Blog Post creations",
"description": "Get your friends Q-Blog posts on your feed",
"search": {
"query": "-post-",
"identifier": "q-blog-",
"service": "BLOG_POST",
"exactmatchnames": true
},
"click": "qortal://APP/Q-Blog/$${resource.name}$$/blog/$${resource.identifier}$$",
"display": {
"title": "$${rawdata.title}$$"
}
}
]
}

View File

@ -1 +0,0 @@
/node_modules

View File

@ -1,22 +0,0 @@
{
"extends" : "standard",
"rules": {
"indent": [
"error",
4,
{
"SwitchCase": 1
}
]
},
"env": {
"es6": true,
"browser": true,
"worker": true
},
"parser": "babel-eslint",
"parserOptions": {
"sourceType": "module",
"allowImportExportEverywhere": true
}
}

View File

@ -70,7 +70,7 @@ html {
--login-border-50pct: rgba(0, 167, 245, 0.5);
--login-border-10pct: rgba(0, 167, 245, 0.1);
--login-button: rgb(3, 169, 244);
--accent-color: #03a9f4;
--general-color-blue: #03a9f4;
--qchat-name: #03a9f4;
--qchat-my-name: #05be0e;
}
@ -147,7 +147,7 @@ html[theme="dark"] {
--login-border-50pct: rgba(0, 167, 245, 0.5);
--login-border-10pct: rgba(0, 167, 245, 0.1);
--login-button: rgb(3, 169, 244);
--accent-color: #03a9f4;
--general-color-blue: #03a9f4;
--qchat-name: #03a9f4;
--qchat-my-name: #05be0e;
}

View File

@ -213,7 +213,8 @@
"arrr1": "ARRR-Wallet nicht initialisiert!",
"arrr2": "Bitte gehen Sie zur Registerkarte „Wallet“ und initialisieren Sie zuerst Ihre arrr-Wallet.",
"arrr3": "Core-Update erforderlich!",
"arrr4": "Um den privaten Schlüssel Ihrer arrr-Wallet zu speichern, benötigen Sie zuerst ein Core-Update!"
"arrr4": "Um den privaten Schlüssel Ihrer arrr-Wallet zu speichern, benötigen Sie zuerst ein Core-Update!",
"sync_indicator": "Synchronisierungsanzeige-Popup deaktivieren"
},
"appinfo": {
"blockheight": "Blockhöhe",

View File

@ -213,7 +213,8 @@
"arrr1": "¡Cartera ARRR no inicializada!",
"arrr2": "Por favor, vaya a la pestaña de billetera e inicialice su billetera arrr primero.",
"arrr3": "¡Necesita actualización principal!",
"arrr4": "¡Para guardar la clave privada de tu billetera arrr, primero necesitas una actualización básica!"
"arrr4": "¡Para guardar la clave privada de tu billetera arrr, primero necesitas una actualización básica!",
"sync_indicator": "Desactivar la ventana emergente del indicador de sincronización"
},
"appinfo": {
"blockheight": "Altura del Bloque",

View File

@ -213,7 +213,8 @@
"arrr1": "ARRR rahakott pole initsialiseeritud!",
"arrr2": "Minge rahakoti vahekaardile ja lähtestage esmalt oma arrr rahakott.",
"arrr3": "Vaja põhivärskendust!",
"arrr4": "Oma arrr rahakoti privaatvõtme salvestamiseks vajate esmalt põhivärskendust!"
"arrr4": "Oma arrr rahakoti privaatvõtme salvestamiseks vajate esmalt põhivärskendust!",
"sync_indicator": "Keela sünkroonimisindikaatori hüpikaken"
},
"appinfo": {
"blockheight": "Ploki kõrgus",

View File

@ -213,7 +213,8 @@
"arrr1": "ARRR-lompakkoa ei ole alustettu!",
"arrr2": "Siirry lompakko-välilehdelle ja nollaa ensin ARRR-lompakkosi.",
"arrr3": "Tarvitaan iso päivitys!",
"arrr4": "Jotta voit tallentaa ARRR-lompakkosi yksityisen avaimesi, tarvitset ensin pääpäivityksen!"
"arrr4": "Jotta voit tallentaa ARRR-lompakkosi yksityisen avaimesi, tarvitset ensin pääpäivityksen!",
"sync_indicator": "Poista synkronoinnin ilmaisimen ponnahdusikkuna"
},
"appinfo": {
"blockheight": "Lohkon korkeus",

View File

@ -213,7 +213,8 @@
"arrr1": "Portefeuille ARRR non initialisé !",
"arrr2": "Veuillez aller dans l'onglet Portefeuille et initialiser d'abord votre portefeuille arrr.",
"arrr3": "Besoin d'une mise à jour principale !",
"arrr4": "Pour sauvegarder la clé privée de votre portefeuille arrr, vous avez d'abord besoin d'une mise à jour principale !"
"arrr4": "Pour sauvegarder la clé privée de votre portefeuille arrr, vous avez d'abord besoin d'une mise à jour principale !",
"sync_indicator": "Désactiver la fenêtre contextuelle de l'indicateur de synchronisation"
},
"appinfo": {
"blockheight": "Hauteur de bloc",

View File

@ -213,7 +213,8 @@
"arrr1": "ARRR वॉलेट प्रारंभ नहीं हुआ!",
"arrr2": "कृपया वॉलेट टैब पर जाएं और पहले अपना Arrr वॉलेट प्रारंभ करें।",
"arrr3": "मुख्य अद्यतन की आवश्यकता है!",
"arrr4": "अपने Arrr वॉलेट की निजी कुंजी को सहेजने के लिए आपको पहले एक कोर अपडेट की आवश्यकता है!"
"arrr4": "अपने Arrr वॉलेट की निजी कुंजी को सहेजने के लिए आपको पहले एक कोर अपडेट की आवश्यकता है!",
"sync_indicator": "सिंक संकेतक पॉपअप अक्षम करें"
},
"appinfo": {
"blockheight": "ब्लॉक ऊँचाई",

View File

@ -213,7 +213,8 @@
"arrr1": "Novčanik ARRR nije inicijaliziran!",
"arrr2": "Idite na karticu novčanika i prvo inicijalizirajte svoj arrr novčanik.",
"arrr3": "Potrebno je ažuriranje jezgre!",
"arrr4": "Da biste spremili privatni ključ vašeg arrr novčanika, prvo trebate ažurirati jezgru!"
"arrr4": "Da biste spremili privatni ključ vašeg arrr novčanika, prvo trebate ažurirati jezgru!",
"sync_indicator": "Onemogući skočni prozor indikatora sinkronizacije"
},
"appinfo": {
"blockheight": "Visina bloka",

View File

@ -213,7 +213,8 @@
"arrr1": "ARRR Wallet nincs inicializálva!",
"arrr2": "Kérjük, lépjen a Wallet fülre, és először inicializálja arrr pénztárcáját.",
"arrr3": "Alapfrissítésre van szükség!",
"arrr4": "Az arrr pénztárca privát kulcsának mentéséhez először egy alapvető frissítésre van szükség!"
"arrr4": "Az arrr pénztárca privát kulcsának mentéséhez először egy alapvető frissítésre van szükség!",
"sync_indicator": "Szinkronizálásjelző előugró ablak letiltása"
},
"appinfo": {
"blockheight": "Blokk Magassága",

View File

@ -213,7 +213,8 @@
"arrr1": "Portafoglio ARRR non inizializzato!",
"arrr2": "Vai alla scheda Portafoglio e inizializza prima il tuo portafoglio arrr.",
"arrr3": "È necessario l'aggiornamento del core!",
"arrr4": "Per salvare la chiave privata del tuo portafoglio arrr devi prima aggiornare il core!"
"arrr4": "Per salvare la chiave privata del tuo portafoglio arrr devi prima aggiornare il core!",
"sync_indicator": "Disabilita il popup dell'indicatore di sincronizzazione"
},
"appinfo": {
"blockheight": "Altezza blocco",

View File

@ -213,7 +213,8 @@
"arrr1": "ARRR ウォレットが初期化されていません!",
"arrr2": "ウォレットタブに移動して、まずarrrウォレットを初期化してください。",
"arrr3": "コアのアップデートが必要です!",
"arrr4": "arrr ウォレットの秘密キーを保存するには、まずコアのアップデートが必要です!"
"arrr4": "arrr ウォレットの秘密キーを保存するには、まずコアのアップデートが必要です!",
"sync_indicator": "同期インジケーターのポップアップを無効にする"
},
"appinfo": {
"blockheight": "ブロック高",

View File

@ -213,7 +213,8 @@
"arrr1": "ARRR 지갑이 초기화되지 않았습니다!",
"arrr2": "지갑 탭으로 이동하여 먼저 arrr 지갑을 초기화하세요.",
"arrr3": "핵심 업데이트가 필요합니다!",
"arrr4": "arrr 지갑의 개인 키를 저장하려면 먼저 핵심 업데이트가 필요합니다!"
"arrr4": "arrr 지갑의 개인 키를 저장하려면 먼저 핵심 업데이트가 필요합니다!",
"sync_indicator": "동기화 표시 팝업 비활성화"
},
"appinfo": {
"blockheight": "블록 높이",

View File

@ -213,7 +213,8 @@
"arrr1": "ARRR portefeuille is niet geïnitialiseerd!",
"arrr2": "Ga naar de portefeuille-tab en initialiseer eerst jouw ARRR portefeuille.",
"arrr3": "De 'core' heeft een update nodig!",
"arrr4": "Om de privé-sleutel van jouw ARRR portefeuille te kunnen bewaren, moet je voor de 'core' eerst een update installeren!"
"arrr4": "Om de privé-sleutel van jouw ARRR portefeuille te kunnen bewaren, moet je voor de 'core' eerst een update installeren!",
"sync_indicator": "Synchronisatie-indicator pop-up uitschakelen"
},
"appinfo": {
"blockheight": "Blokhoogte",

View File

@ -213,7 +213,8 @@
"arrr1": "ARRR-lommebok ikke initialisert !",
"arrr2": "Vennligst gå til lommebok-fanen og initialiser arrr-lommeboken først.",
"arrr3": "Trenger kjerneoppdatering!",
"arrr4": "For å lagre den private nøkkelen til arrr-lommeboken din trenger du en kjerneoppdatering først!"
"arrr4": "For å lagre den private nøkkelen til arrr-lommeboken din trenger du en kjerneoppdatering først!",
"sync_indicator": "Deaktiver popup for synkroniseringsindikator"
},
"appinfo": {
"blockheight": "Blokkhøyde",

View File

@ -213,7 +213,8 @@
"arrr1": "Portfel ARRR nie został zainicjowany!",
"arrr2": "Przejdź do zakładki portfela i najpierw zainicjalizuj swój portfel arrr.",
"arrr3": "Potrzebujesz aktualizacji rdzenia!",
"arrr4": "Aby zapisać klucz prywatny swojego portfela arrr, potrzebujesz najpierw aktualizacji rdzenia!"
"arrr4": "Aby zapisać klucz prywatny swojego portfela arrr, potrzebujesz najpierw aktualizacji rdzenia!",
"sync_indicator": "Wyłącz wyskakujące okienko wskaźnika synchronizacji"
},
"appinfo": {
"blockheight": "Wysokość bloku",

View File

@ -213,7 +213,8 @@
"arrr1": "Carteira ARRR não inicializada!",
"arrr2": "Por favor, vá para a aba carteira e inicialize sua carteira arrr primeiro.",
"arrr3": "Precisa de atualização principal!",
"arrr4": "Para salvar a chave privada da sua carteira arrr você precisa primeiro de uma atualização principal!"
"arrr4": "Para salvar a chave privada da sua carteira arrr você precisa primeiro de uma atualização principal!",
"sync_indicator": "Desativar pop-up do indicador de sincronização"
},
"appinfo": {
"blockheight": "Altura do Bloco",

View File

@ -213,7 +213,8 @@
"arrr1": "Portoletul ARRR nu este inițializat !",
"arrr2": "Vă rugăm să accesați fila Portofel și să inițializați mai întâi portofelul arrr.",
"arrr3": "Am nevoie de actualizare de bază !",
"arrr4": "Pentru a salva cheia privată a portofelului dvs. arrr, aveți nevoie mai întâi de o actualizare de bază !"
"arrr4": "Pentru a salva cheia privată a portofelului dvs. arrr, aveți nevoie mai întâi de o actualizare de bază !",
"sync_indicator": "Dezactivați fereastra pop-up indicator de sincronizare"
},
"appinfo": {
"blockheight": "Dimensiunea blocului",

View File

@ -213,7 +213,8 @@
"arrr1": "ARRR novčanik nije inicijalizovan!",
"arrr2": "Molim vas idite na karticu Novčanik i prvo inicijalizujte svoj arrr novčanik.",
"arrr3": "Potrebno je ažuriranje jezgra!",
"arrr4": "Da biste sačuvali privatni ključ vašeg arrr novčanika, prvo vam je potrebno ažuriranje jezgra!"
"arrr4": "Da biste sačuvali privatni ključ vašeg arrr novčanika, prvo vam je potrebno ažuriranje jezgra!",
"sync_indicator": "Onemogući iskačući prozor indikatora sinhronizacije"
},
"appinfo": {
"blockheight": "Visina Bloka",

View File

@ -213,7 +213,8 @@
"arrr1": "Кошелек ARRR не инициализирован!",
"arrr2": "Пожалуйста, перейдите на вкладку кошелька и сначала инициализируйте свой кошелек arrr.",
"arrr3": "Требуется обновление ядра!",
"arrr4": "Чтобы сохранить закрытый ключ вашего кошелька arrr, вам сначала необходимо обновить ядро!"
"arrr4": "Чтобы сохранить закрытый ключ вашего кошелька arrr, вам сначала необходимо обновить ядро!",
"sync_indicator": "Отключить всплывающее окно индикатора синхронизации"
},
"appinfo": {
"blockheight": "Высота блока",

View File

@ -213,7 +213,8 @@
"arrr1": "ARRR Wallet Not Initialized !",
"arrr2": "Please go to wallet tab and initialize your arrr wallet first.",
"arrr3": "Need Core Update !",
"arrr4": "To save the private key of your arrr wallet you need a core update first !"
"arrr4": "To save the private key of your arrr wallet you need a core update first !",
"sync_indicator": "Disable sync indicator popup"
},
"appinfo": {
"blockheight": "Block Height",

View File

@ -213,7 +213,8 @@
"arrr1": "ARRR 钱包未初始化!",
"arrr2": "请先进入钱包选项卡并初始化您的arrr钱包。",
"arrr3": "需要核心更新!",
"arrr4": "要保存你的 arr 钱包的私钥,你需要先进行核心更新!"
"arrr4": "要保存你的 arr 钱包的私钥,你需要先进行核心更新!",
"sync_indicator": "禁用同步指示器弹出窗口"
},
"appinfo": {
"blockheight": "区块高度",

View File

@ -213,7 +213,8 @@
"arrr1": "ARRR 錢包未初始化!",
"arrr2": "請先進入錢包標籤並初始化您的arrr錢包。",
"arrr3": "需要核心更新!",
"arrr4": "要儲存你的 arr 錢包的私鑰,你需要先進行核心更新!"
"arrr4": "要儲存你的 arr 錢包的私鑰,你需要先進行核心更新!",
"sync_indicator": "停用同步指示器彈出視窗"
},
"appinfo": {
"blockheight": "區塊高度",

View File

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

View File

@ -1,105 +1,70 @@
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 '../../translate/index.js'
import WebWorker from 'web-worker:./computePowWorker.js';
import {routes} from '../plugins/routes.js';
import '@material/mwc-icon'
import '@material/mwc-button'
import {translate} from '../../translate'
class AppInfo extends connect(store)(LitElement) {
static get properties() {
return {
blockInfo: { type: Object },
nodeStatus: { type: Object },
nodeInfo: { type: Array },
coreInfo: { type: Array },
nodeConfig: { type: Object },
pageUrl: { type: String },
publicizeAddress: { type: String },
theme: { type: String, reflect: true }
}
}
static get styles() {
return [
css`
* {
--mdc-theme-primary: rgb(3, 169, 244);
--paper-input-container-focus-color: var(--mdc-theme-primary);
}
.normal {
--mdc-theme-primary: rgb(3, 169, 244);
}
return css`
* {
--mdc-theme-primary: rgb(3, 169, 244);
--paper-input-container-focus-color: var(--mdc-theme-primary);
}
.normal-button {
--mdc-theme-primary: rgb(3, 169, 244);
--mdc-theme-on-primary: white;
}
.normal {
--mdc-theme-primary: rgb(3, 169, 244);
}
mwc-button.normal-button {
--mdc-theme-primary: rgb(3, 169, 244);
--mdc-theme-on-primary: white;
}
.test-net {
--mdc-theme-primary: black;
}
#profileInMenu {
flex: 0 0 100px;
padding:12px;
border-top: 1px solid var(--border);
background: var(--sidetopbar);
}
.test-net-button {
--mdc-theme-primary: black;
--mdc-theme-on-primary: white;
}
.info {
margin: 0;
font-size: 14px;
font-weight: 100;
display: inline-block;
width: 100%;
padding-bottom: 8px;
color: var(--black);
}
mwc-button.test-net-button {
--mdc-theme-primary: black;
--mdc-theme-on-primary: white;
}
#profileInMenu {
flex: 0 0 100px;
padding:12px;
border-top: 1px solid var(--border);
background: var(--sidetopbar);
}
.info {
margin: 0;
font-size: 14px;
font-weight:100;
display: inline-block;
width:100%;
padding-bottom:8px;
color: var(--black);
}
.blue {
color: #03a9f4;
margin: 0;
font-size: 14px;
font-weight:200;
display: inline;
}
.black {
color: var(--black);
margin: 0;
font-size: 14px;
font-weight:200;
display: inline;
}
`
]
.blue {
color: #03a9f4;
margin: 0;
font-size: 14px;
font-weight: 200;
display: inline;
}
.black {
color: var(--black);
margin: 0;
font-size: 14px;
font-weight: 200;
display: inline;
}
`
}
constructor() {
super()
this.blockInfo = {}
this.nodeInfo = []
this.coreInfo = []
this.nodeStatus = {}
this.pageUrl = ''
this.publicizeAddress = ''
this.nodeConfig = {}
this.theme = localStorage.getItem('qortalTheme') ? localStorage.getItem('qortalTheme') : 'light'
this.publicKeyisOnChainConfirmation = false
this.interval
}
render() {
@ -115,133 +80,25 @@ class AppInfo extends connect(store)(LitElement) {
}
firstUpdated() {
this.publicizeAddress = store.getState().app.selectedAddress.address + '_publicize'
this.setStorage()
this.getNodeInfo()
this.getCoreInfo()
// try {
// this.confirmPublicKeyOnChain(store.getState().app.selectedAddress.address)
// } catch (error) {
// console.error(error)
// }
setInterval(() => {
this.getNodeInfo()
this.getCoreInfo()
}, 30000)
}
setStorage() {
if (localStorage.getItem(this.publicizeAddress) === null) {
localStorage.setItem(this.publicizeAddress, 'false')
}
}
async confirmPublicKeyOnChain(address) {
const _computePow2 = async (chatBytes) => {
const difficulty = 14
const path = window.parent.location.origin + '/memory-pow/memory-pow.wasm.full'
const worker = new WebWorker();
let nonce = null
let chatBytesArray = null
await new Promise((res, rej) => {
worker.postMessage({chatBytes, path, difficulty})
worker.onmessage = e => {
worker.terminate()
chatBytesArray = e.data.chatBytesArray
nonce = e.data.nonce
res()
}
})
let _response = await routes.sign_chat({
data: {
nonce: store.getState().app.selectedAddress.nonce,
chatBytesArray: chatBytesArray,
chatNonce: nonce
},
})
return _response
}
let stop = false
const checkPublicKey = async () => {
if (!stop) {
stop = true
try {
if(localStorage.getItem(this.publicizeAddress) === 'true') {
clearInterval(this.interval)
return
}
const myNode = store.getState().app.nodeConfig.knownNodes[store.getState().app.nodeConfig.node]
const nodeUrl = myNode.protocol + '://' + myNode.domain + ':' + myNode.port
const url = `${nodeUrl}/addresses/publickey/${address}`
const res = await fetch(url)
let data = ''
try {
data = await res.text()
} catch (error) {
data = {
error: 'error'
}
}
if(data === 'false' && this.nodeInfo.isSynchronizing !== true) {
let _reference = new Uint8Array(64)
window.crypto.getRandomValues(_reference)
let reference = window.parent.Base58.encode(_reference)
const chatRes = await routes.chat({
data: {
type: 19,
nonce: store.getState().app.selectedAddress.nonce,
params: {
lastReference: reference,
proofOfWorkNonce: 0,
fee: 0,
timestamp: Date.now(),
},
disableModal: true
},
disableModal: true,
});
try {
const powRes = await _computePow2(chatRes)
if(powRes === true) {
clearInterval(this.interval)
localStorage.removeItem(this.publicizeAddress)
localStorage.setItem(this.publicizeAddress, 'true')
}
} catch (error) {
console.error(error)
}
}
if (!data.error && data !== 'false' && data) {
clearInterval(this.interval)
localStorage.removeItem(this.publicizeAddress)
localStorage.setItem(this.publicizeAddress, 'true')
}
} catch (error) {
}
stop = false
}
}
this.interval = setInterval(checkPublicKey, 5000);
}, 60000)
}
async getNodeInfo() {
const appinfoNode = store.getState().app.nodeConfig.knownNodes[store.getState().app.nodeConfig.node]
const appinfoUrl = appinfoNode.protocol + '://' + appinfoNode.domain + ':' + appinfoNode.port
const url = `${appinfoUrl}/admin/status`
await fetch(url).then(response => {
return response.json()
})
.then(data => {
}).then(data => {
this.nodeInfo = data
})
.catch(err => {
}).catch(err => {
console.error('Request failed', err)
})
}
@ -250,13 +107,12 @@ class AppInfo extends connect(store)(LitElement) {
const appinfoNode = store.getState().app.nodeConfig.knownNodes[store.getState().app.nodeConfig.node]
const appinfoUrl = appinfoNode.protocol + '://' + appinfoNode.domain + ':' + appinfoNode.port
const url = `${appinfoUrl}/admin/info`
await fetch(url).then(response => {
return response.json()
})
.then(data => {
}).then(data => {
this.coreInfo = data
})
.catch(err => {
}).catch(err => {
console.error('Request failed', err)
})
}
@ -283,21 +139,8 @@ class AppInfo extends connect(store)(LitElement) {
return html`<span class="info">${translate("appinfo.coreversion")}: ${this.coreInfo.buildVersion ? this.coreInfo.buildVersion : ''}</span>`
}
gotoPage(url) {
const myLink = this.shadowRoot.querySelector('#pageLink')
myLink.href = url
myLink.click()
store.dispatch(doPageUrl(''))
}
stateChanged(state) {
this.blockInfo = state.app.blockInfo
this.nodeStatus = state.app.nodeStatus
this.nodeConfig = state.app.nodeConfig
this.pageUrl = state.app.pageUrl
if (this.pageUrl.length > 5) {
this.gotoPage(this.pageUrl)
}
}
}

View File

@ -1,12 +1,12 @@
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 '../../translate/index.js'
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 '../../translate'
import localForage from 'localforage'
import { decryptData, encryptData } 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'
import '@material/mwc-button'
import '@material/mwc-icon'
@ -35,7 +35,6 @@ import './search-modal.js'
import './user-info-view/user-info-view.js'
import '../functional-components/side-menu.js'
import '../functional-components/side-menu-item.js'
import './start-minting.js'
import './notification-view/notification-bell.js'
import './notification-view/notification-bell-general.js'
import './friends-view/friends-side-panel-parent.js'
@ -147,7 +146,8 @@ class AppView extends connect(store)(LitElement) {
lockSet: { type: String },
myLockScreenPass: { type: String },
myLockScreenSet: { type: String },
helperMessage: { type: String }
helperMessage: { type: String },
showSyncMessages: { type: Boolean }
}
}
@ -548,7 +548,6 @@ class AppView extends connect(store)(LitElement) {
getTourElements(){
let els = {}
console.log('this.shadowRoot.querySelector("core-sync-status")', this.shadowRoot.querySelector("core-sync-status"))
const el1 = this.shadowRoot.querySelector("core-sync-status").shadowRoot.getElementById("core-sync-status-id")
const el2 = this.shadowRoot.querySelector("show-plugin").shadowRoot.getElementById("showPluginId")
const el3 = this.shadowRoot.querySelector("beginner-checklist").shadowRoot.getElementById("popover-notification")
@ -561,7 +560,7 @@ class AppView extends connect(store)(LitElement) {
if(el3) {
els['checklist'] = el3
}
return els
}
@ -625,7 +624,7 @@ class AppView extends connect(store)(LitElement) {
</app-header>
<show-plugin></show-plugin>
<tour-component .getElements=${this.getTourElements}></tour-component>
<sync-indicator ></sync-indicator>
${!this.showSyncMessages ? html`<sync-indicator></sync-indicator>` : html``}
</app-header-layout>
</app-drawer-layout>
<user-info-view></user-info-view>
@ -698,6 +697,8 @@ class AppView extends connect(store)(LitElement) {
this.helperMessage = this.renderHelperPass()
this.showSyncMessages = store.getState().app.showSyncIndicator
this.salt = ''
this.salt = Base58.encode(store.getState().app.wallet._addresses[0].keyPair.privateKey)
@ -745,7 +746,7 @@ class AppView extends connect(store)(LitElement) {
drawerTog.click()
})
this.getNodeType()
await this.getNodeType()
const myAppNode = store.getState().app.nodeConfig.knownNodes[store.getState().app.nodeConfig.node]
const nodeAppUrl = myAppNode.protocol + '://' + myAppNode.domain + ':' + myAppNode.port
@ -914,7 +915,7 @@ class AppView extends connect(store)(LitElement) {
await filterOpenOfferBTC()
await appDelay(1000)
filterMyBotPriceTradesBTC()
await filterMyBotPriceTradesBTC()
setTimeout(getOpenTradesBTC, 150000)
}
}
@ -922,11 +923,9 @@ class AppView extends connect(store)(LitElement) {
const filterMyBotPriceTradesBTC = async () => {
const tradeBotBtcUrl = `${nodeAppUrl}/crosschain/tradebot?foreignBlockchain=BITCOIN&apiKey=${this.getApiKey()}`
const tradeBotBtcAt = await fetch(tradeBotBtcUrl).then(response => {
return response.json()
})
this.tradeBotBtcAt = tradeBotBtcAt
this.tradeBotBtcAt = await fetch(tradeBotBtcUrl).then(response => {
return response.json()
})
await appDelay(1000)
@ -964,7 +963,7 @@ class AppView extends connect(store)(LitElement) {
await appDelay(1000)
if (this.isEmptyArray(this.tradeBotAvailableBtcQortal) === true) {
return
} else {
const botbtcprice = this.round(parseFloat(this.tradeBotBtcBook[0].botBtcPrice))
const changebtcamount = parseFloat(this.tradeBotBtcBook[0].botBtcQortAmount)
@ -995,7 +994,7 @@ class AppView extends connect(store)(LitElement) {
await appDelay(1000)
this.buyBtcAction()
await this.buyBtcAction()
if (this.isEmptyArray(this.tradeBotBtcBook) === true) {
return
@ -1008,7 +1007,7 @@ class AppView extends connect(store)(LitElement) {
}
if (this.isEmptyArray(this.tradeBotBtcBook) === true) {
return
} else {
const checkBotBtcFunds = this.round(parseFloat(this.tradeBotBtcBook[0].botBtcQortAmount) * parseFloat(this.tradeBotBtcBook[0].botBtcPrice))
const myBotBtcFunds = this.round(parseFloat(this.btcWalletBalance))
@ -1111,7 +1110,7 @@ class AppView extends connect(store)(LitElement) {
await filterOpenOfferLTC()
await appDelay(1000)
filterMyBotPriceTradesLTC()
await filterMyBotPriceTradesLTC()
setTimeout(getOpenTradesLTC, 150000)
}
}
@ -1119,11 +1118,9 @@ class AppView extends connect(store)(LitElement) {
const filterMyBotPriceTradesLTC = async () => {
const tradeBotLtcUrl = `${nodeAppUrl}/crosschain/tradebot?foreignBlockchain=LITECOIN&apiKey=${this.getApiKey()}`
const tradeBotLtcAt = await fetch(tradeBotLtcUrl).then(response => {
return response.json()
})
this.tradeBotLtcAt = tradeBotLtcAt
this.tradeBotLtcAt = await fetch(tradeBotLtcUrl).then(response => {
return response.json()
})
await appDelay(1000)
@ -1161,7 +1158,7 @@ class AppView extends connect(store)(LitElement) {
await appDelay(1000)
if (this.isEmptyArray(this.tradeBotAvailableLtcQortal) === true) {
return
} else {
const botltcprice = this.round(parseFloat(this.tradeBotLtcBook[0].botLtcPrice))
const changeltcamount = parseFloat(this.tradeBotLtcBook[0].botLtcQortAmount)
@ -1192,7 +1189,7 @@ class AppView extends connect(store)(LitElement) {
await appDelay(1000)
this.buyLtcAction()
await this.buyLtcAction()
if (this.isEmptyArray(this.tradeBotLtcBook) === true) {
return
@ -1205,7 +1202,7 @@ class AppView extends connect(store)(LitElement) {
}
if (this.isEmptyArray(this.tradeBotLtcBook) === true) {
return
} else {
const checkBotLtcFunds = this.round(parseFloat(this.tradeBotLtcBook[0].botLtcQortAmount) * parseFloat(this.tradeBotLtcBook[0].botLtcPrice))
const myBotLtcFunds = this.round(parseFloat(this.ltcWalletBalance))
@ -1297,7 +1294,7 @@ class AppView extends connect(store)(LitElement) {
await filterOpenOfferDOGE()
await appDelay(1000)
filterMyBotPriceTradesDOGE()
await filterMyBotPriceTradesDOGE()
setTimeout(getOpenTradesDOGE, 150000)
}
}
@ -1305,11 +1302,9 @@ class AppView extends connect(store)(LitElement) {
const filterMyBotPriceTradesDOGE = async () => {
const tradeBotDogeUrl = `${nodeAppUrl}/crosschain/tradebot?foreignBlockchain=DOGECOIN&apiKey=${this.getApiKey()}`
const tradeBotDogeAt = await fetch(tradeBotDogeUrl).then(response => {
return response.json()
})
this.tradeBotDogeAt = tradeBotDogeAt
this.tradeBotDogeAt = await fetch(tradeBotDogeUrl).then(response => {
return response.json()
})
await appDelay(1000)
@ -1347,7 +1342,7 @@ class AppView extends connect(store)(LitElement) {
await appDelay(1000)
if (this.isEmptyArray(this.tradeBotAvailableDogeQortal) === true) {
return
} else {
const botdogeprice = this.round(parseFloat(this.tradeBotDogeBook[0].botDogePrice))
const changedogeamount = parseFloat(this.tradeBotDogeBook[0].botDogeQortAmount)
@ -1378,7 +1373,7 @@ class AppView extends connect(store)(LitElement) {
await appDelay(1000)
this.buyDogeAction()
await this.buyDogeAction()
if (this.isEmptyArray(this.tradeBotDogeBook) === true) {
return
@ -1391,7 +1386,7 @@ class AppView extends connect(store)(LitElement) {
}
if (this.isEmptyArray(this.tradeBotDogeBook) === true) {
return
} else {
const checkBotDogeFunds = this.round(parseFloat(this.tradeBotDogeBook[0].botDogeQortAmount) * parseFloat(this.tradeBotDogeBook[0].botDogePrice))
const myBotDogeFunds = this.round(parseFloat(this.dogeWalletBalance))
@ -1483,7 +1478,7 @@ class AppView extends connect(store)(LitElement) {
await filterOpenOfferDGB()
await appDelay(1000)
filterMyBotPriceTradesDGB()
await filterMyBotPriceTradesDGB()
setTimeout(getOpenTradesDGB, 150000)
}
}
@ -1491,11 +1486,9 @@ class AppView extends connect(store)(LitElement) {
const filterMyBotPriceTradesDGB = async () => {
const tradeBotDgbUrl = `${nodeAppUrl}/crosschain/tradebot?foreignBlockchain=DIGIBYTE&apiKey=${this.getApiKey()}`
const tradeBotDgbAt = await fetch(tradeBotDgbUrl).then(response => {
return response.json()
})
this.tradeBotDgbAt = tradeBotDgbAt
this.tradeBotDgbAt = await fetch(tradeBotDgbUrl).then(response => {
return response.json()
})
await appDelay(1000)
@ -1533,7 +1526,7 @@ class AppView extends connect(store)(LitElement) {
await appDelay(1000)
if (this.isEmptyArray(this.tradeBotAvailableDgbQortal) === true) {
return
} else {
const botdgbprice = this.round(parseFloat(this.tradeBotDgbBook[0].botDgbPrice))
const changedgbamount = parseFloat(this.tradeBotDgbBook[0].botDgbQortAmount)
@ -1564,7 +1557,7 @@ class AppView extends connect(store)(LitElement) {
await appDelay(1000)
this.buyDgbAction()
await this.buyDgbAction()
if (this.isEmptyArray(this.tradeBotDgbBook) === true) {
return
@ -1577,7 +1570,7 @@ class AppView extends connect(store)(LitElement) {
}
if (this.isEmptyArray(this.tradeBotDgbBook) === true) {
return
} else {
const checkBotDgbFunds = this.round(parseFloat(this.tradeBotDgbBook[0].botDgbQortAmount) * parseFloat(this.tradeBotDgbBook[0].botDgbPrice))
const myBotDgbFunds = this.round(parseFloat(this.dgbWalletBalance))
@ -1669,7 +1662,7 @@ class AppView extends connect(store)(LitElement) {
await filterOpenOfferRVN()
await appDelay(1000)
filterMyBotPriceTradesRVN()
await filterMyBotPriceTradesRVN()
setTimeout(getOpenTradesRVN, 150000)
}
}
@ -1677,11 +1670,9 @@ class AppView extends connect(store)(LitElement) {
const filterMyBotPriceTradesRVN = async () => {
const tradeBotRvnUrl = `${nodeAppUrl}/crosschain/tradebot?foreignBlockchain=RAVENCOIN&apiKey=${this.getApiKey()}`
const tradeBotRvnAt = await fetch(tradeBotRvnUrl).then(response => {
return response.json()
})
this.tradeBotRvnAt = tradeBotRvnAt
this.tradeBotRvnAt = await fetch(tradeBotRvnUrl).then(response => {
return response.json()
})
await appDelay(1000)
@ -1719,7 +1710,7 @@ class AppView extends connect(store)(LitElement) {
await appDelay(1000)
if (this.isEmptyArray(this.tradeBotAvailableRvnQortal) === true) {
return
} else {
const botrvnprice = this.round(parseFloat(this.tradeBotRvnBook[0].botRvnPrice))
const changervnamount = parseFloat(this.tradeBotRvnBook[0].botRvnQortAmount)
@ -1750,7 +1741,7 @@ class AppView extends connect(store)(LitElement) {
await appDelay(1000)
this.buyRvnAction()
await this.buyRvnAction()
if (this.isEmptyArray(this.tradeBotRvnBook) === true) {
return
@ -1763,7 +1754,7 @@ class AppView extends connect(store)(LitElement) {
}
if (this.isEmptyArray(this.tradeBotRvnBook) === true) {
return
} else {
const checkBotRvnFunds = this.round(parseFloat(this.tradeBotRvnBook[0].botRvnQortAmount) * parseFloat(this.tradeBotRvnBook[0].botRvnPrice))
const myBotRvnFunds = this.round(parseFloat(this.rvnWalletBalance))
@ -1855,7 +1846,7 @@ class AppView extends connect(store)(LitElement) {
await filterOpenOfferARRR()
await appDelay(1000)
filterMyBotPriceTradesARRR()
await filterMyBotPriceTradesARRR()
setTimeout(getOpenTradesARRR, 150000)
}
}
@ -1863,11 +1854,9 @@ class AppView extends connect(store)(LitElement) {
const filterMyBotPriceTradesARRR = async () => {
const tradeBotArrrUrl = `${nodeAppUrl}/crosschain/tradebot?foreignBlockchain=PIRATECHAIN&apiKey=${this.getApiKey()}`
const tradeBotArrrAt = await fetch(tradeBotArrrUrl).then(response => {
return response.json()
})
this.tradeBotArrrAt = tradeBotArrrAt
this.tradeBotArrrAt = await fetch(tradeBotArrrUrl).then(response => {
return response.json()
})
await appDelay(1000)
@ -1905,7 +1894,7 @@ class AppView extends connect(store)(LitElement) {
await appDelay(1000)
if (this.isEmptyArray(this.tradeBotAvailableArrrQortal) === true) {
return
} else {
const botarrrprice = this.round(parseFloat(this.tradeBotArrrBook[0].botArrrPrice))
const changearrramount = parseFloat(this.tradeBotArrrBook[0].botArrrQortAmount)
@ -1936,7 +1925,7 @@ class AppView extends connect(store)(LitElement) {
await appDelay(1000)
this.buyArrrAction()
await this.buyArrrAction()
if (this.isEmptyArray(this.tradeBotArrrBook) === true) {
return
@ -1949,7 +1938,7 @@ class AppView extends connect(store)(LitElement) {
}
if (this.isEmptyArray(this.tradeBotArrrBook) === true) {
return
} else {
const checkBotArrrFunds = this.round(parseFloat(this.tradeBotArrrBook[0].botArrrQortAmount) * parseFloat(this.tradeBotArrrBook[0].botArrrPrice))
const myBotArrrFunds = this.round(parseFloat(this.arrrWalletBalance))
@ -2117,10 +2106,6 @@ class AppView extends connect(store)(LitElement) {
${this.renderNodeManagement()}
</side-menu-item>
<div>
<start-minting></start-minting>
</div>
`
}
}
@ -2246,7 +2231,7 @@ class AppView extends connect(store)(LitElement) {
this.helperMessage = this.renderHelperErr()
await errDelay(3000)
this.helperMessage = this.renderHelperPass()
return
}
}
@ -2454,12 +2439,11 @@ class AppView extends connect(store)(LitElement) {
async buyBtcAction() {
const makeRequest = async () => {
const response = await parentEpml.request('tradeBotRespondRequest', {
atAddress: this.botBtcBuyAtAddress,
foreignKey: store.getState().app.selectedAddress.btcWallet.derivedMasterPrivateKey,
receivingAddress: store.getState().app.selectedAddress.address,
})
return response
return await parentEpml.request('tradeBotRespondRequest', {
atAddress: this.botBtcBuyAtAddress,
foreignKey: store.getState().app.selectedAddress.btcWallet.derivedMasterPrivateKey,
receivingAddress: store.getState().app.selectedAddress.address,
})
}
const manageResponse = (response) => {
@ -2512,12 +2496,11 @@ class AppView extends connect(store)(LitElement) {
async buyLtcAction() {
const makeRequest = async () => {
const response = await parentEpml.request('tradeBotRespondRequest', {
atAddress: this.botLtcBuyAtAddress,
foreignKey: store.getState().app.selectedAddress.ltcWallet.derivedMasterPrivateKey,
receivingAddress: store.getState().app.selectedAddress.address,
})
return response
return await parentEpml.request('tradeBotRespondRequest', {
atAddress: this.botLtcBuyAtAddress,
foreignKey: store.getState().app.selectedAddress.ltcWallet.derivedMasterPrivateKey,
receivingAddress: store.getState().app.selectedAddress.address,
})
}
const manageResponse = (response) => {
@ -2570,12 +2553,11 @@ class AppView extends connect(store)(LitElement) {
async buyDogeAction() {
const makeRequest = async () => {
const response = await parentEpml.request('tradeBotRespondRequest', {
atAddress: this.botDogeBuyAtAddress,
foreignKey: store.getState().app.selectedAddress.dogeWallet.derivedMasterPrivateKey,
receivingAddress: store.getState().app.selectedAddress.address,
})
return response
return await parentEpml.request('tradeBotRespondRequest', {
atAddress: this.botDogeBuyAtAddress,
foreignKey: store.getState().app.selectedAddress.dogeWallet.derivedMasterPrivateKey,
receivingAddress: store.getState().app.selectedAddress.address,
})
}
const manageResponse = (response) => {
@ -2628,12 +2610,11 @@ class AppView extends connect(store)(LitElement) {
async buyDgbAction() {
const makeRequest = async () => {
const response = await parentEpml.request('tradeBotRespondRequest', {
atAddress: this.botDgbBuyAtAddress,
foreignKey: store.getState().app.selectedAddress.dgbWallet.derivedMasterPrivateKey,
receivingAddress: store.getState().app.selectedAddress.address,
})
return response
return await parentEpml.request('tradeBotRespondRequest', {
atAddress: this.botDgbBuyAtAddress,
foreignKey: store.getState().app.selectedAddress.dgbWallet.derivedMasterPrivateKey,
receivingAddress: store.getState().app.selectedAddress.address,
})
}
const manageResponse = (response) => {
@ -2686,12 +2667,11 @@ class AppView extends connect(store)(LitElement) {
async buyRvnAction() {
const makeRequest = async () => {
const response = await parentEpml.request('tradeBotRespondRequest', {
atAddress: this.botRvnBuyAtAddress,
foreignKey: store.getState().app.selectedAddress.rvnWallet.derivedMasterPrivateKey,
receivingAddress: store.getState().app.selectedAddress.address,
})
return response
return await parentEpml.request('tradeBotRespondRequest', {
atAddress: this.botRvnBuyAtAddress,
foreignKey: store.getState().app.selectedAddress.rvnWallet.derivedMasterPrivateKey,
receivingAddress: store.getState().app.selectedAddress.address,
})
}
const manageResponse = (response) => {
@ -2744,12 +2724,11 @@ class AppView extends connect(store)(LitElement) {
async buyArrrAction() {
const makeRequest = async () => {
const response = await parentEpml.request('tradeBotRespondRequest', {
atAddress: this.botArrrBuyAtAddress,
foreignKey: store.getState().app.selectedAddress.arrrWallet.seed58,
receivingAddress: store.getState().app.selectedAddress.address,
})
return response
return await parentEpml.request('tradeBotRespondRequest', {
atAddress: this.botArrrBuyAtAddress,
foreignKey: store.getState().app.selectedAddress.arrrWallet.seed58,
receivingAddress: store.getState().app.selectedAddress.address,
})
}
const manageResponse = (response) => {
@ -2806,6 +2785,7 @@ class AppView extends connect(store)(LitElement) {
this.config = state.config
this.urls = state.app.registeredUrls
this.addressInfo = state.app.accountInfo.addressInfo
this.showSyncMessages = state.app.showSyncIndicator
if (sideurl === "minting") {
this.shadowRoot.getElementById('qminter').setAttribute('selected', 'selected')
@ -3350,8 +3330,7 @@ class AppView extends connect(store)(LitElement) {
getApiKey() {
const apiNode = store.getState().app.nodeConfig.knownNodes[store.getState().app.nodeConfig.node]
let apiKey = apiNode.apiKey
return apiKey
return apiNode.apiKey
}
isEmptyArray(arr) {
@ -3362,9 +3341,8 @@ class AppView extends connect(store)(LitElement) {
}
round(number) {
let result = (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
return result
return (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
}
}
window.customElements.define('app-view', AppView)
window.customElements.define('app-view', AppView)

View File

@ -1,30 +1,34 @@
import { LitElement, html, css } from 'lit';
import { store } from '../../store';
import { connect } from 'pwa-helpers';
import '@material/mwc-icon';
import { translate } from '../../../translate';
import { parentEpml } from '../show-plugin';
import {css, html, LitElement} from 'lit'
import {store} from '../../store'
import {connect} from 'pwa-helpers'
import {translate} from '../../../translate'
import {parentEpml} from '../show-plugin'
import '@material/mwc-icon'
class SyncIndicator extends connect(store)(LitElement) {
static get properties() {
return {
isBehind: { type: Boolean },
blocksBehind: { type: Number },
nodeUrl: { type: String },
address: { type: String },
isBehind: { type: Boolean },
isSynchronizing: { type: Boolean },
hasCoreRunning: { type: Boolean },
};
hasCoreRunning: { type: Boolean }
}
}
constructor() {
super();
this.isBehind = null;
this.blocksBehind = 0;
this.nodeUrl = this.getNodeUrl();
this.myNode = this.getMyNode();
this.interval = null;
this.hasCoreRunning = true;
this.seenWelcomeSync = false;
this.numberOfTries = 0;
super()
this.blocksBehind = 0
this.nodeUrl = ''
this.address = ''
this.isBehind = false
this.isSynchronizing = false
this.hasCoreRunning = true
this.interval = null
this.seenWelcomeSync = false
this.numberOfTries = 0
this.hasOpened = false
}
@ -34,13 +38,15 @@ class SyncIndicator extends connect(store)(LitElement) {
--mdc-theme-text-primary-on-background: var(--black);
box-sizing: border-box;
}
:host {
box-sizing: border-box;
position: fixed;
bottom: 25px;
bottom: 50px;
right: 25px;
z-index: 50000;
}
.parent {
width: 360px;
padding: 10px;
@ -52,17 +58,20 @@ class SyncIndicator extends connect(store)(LitElement) {
user-select: none;
background: var(--white);
}
.row {
display: flex;
gap: 10px;
width: 100%;
}
.column {
display: flex;
flex-direction: column;
gap: 10px;
width: 100%;
}
.bootstrap-button {
font-family: Roboto, sans-serif;
font-size: 16px;
@ -78,60 +87,96 @@ class SyncIndicator extends connect(store)(LitElement) {
cursor: pointer;
background-color: #03a8f475;
}
`;
`
}
async firstUpdated() {
render() {
return html`
${!this.hasCoreRunning ? html`
<div class="parent">
<span>
<mwc-icon id="notification-general-icon" style="color: red; cursor:pointer;user-select:none">
priority_high
</mwc-icon>
</span>
<p>
${translate("tour.tour17")}
</p>
</div>
` : (this.blocksBehind > 1050 && this.isSynchronizing) ? html`
<div class="parent">
<div class="column">
<div class="row">
<span>
<img src="/img/syncing.png" style="height: 24px; width: 24px;" />
</span>
<p>
${this.blocksBehind} ${translate("tour.tour20")}
</p>
</div>
<div class="row" style="justify-content: center">
<button class="bootstrap-button" @click="${() => {this.bootstrap()}}">
${translate("tour.tour18")}
</button>
</div>
</div>
</div>
` : this.isSynchronizing ? html`
<div class="parent">
<span>
<img src="/img/syncing.png" style="height: 24px; width: 24px;" />
</span>
<p>
${translate("tour.tour19")} ${this.blocksBehind ? this.blocksBehind : ""} ${this.blocksBehind ? translate("tour.tour21"): ""}
</p>
</div>
` : "" }
`
}
firstUpdated() {
this.getNodeUrl()
this.address = store.getState().app.selectedAddress.address
const seenWelcomeSync = JSON.parse(
this.seenWelcomeSync = JSON.parse(
localStorage.getItem(`welcome-sync-${this.address}`) || 'false'
);
this.seenWelcomeSync = seenWelcomeSync;
)
setInterval(() => {
this.getNodeUrl()
}, 60000)
}
getNodeUrl() {
const myNode =
window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
window.parent.reduxStore.getState().app.nodeConfig.node
];
const nodeUrl =
myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
return nodeUrl;
}
getMyNode() {
const myNode =
window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
window.parent.reduxStore.getState().app.nodeConfig.node
];
return myNode;
const syncInfoNode = store.getState().app.nodeConfig.knownNodes[store.getState().app.nodeConfig.node]
const syncInfoUrl = syncInfoNode.protocol + '://' + syncInfoNode.domain + ':' + syncInfoNode.port
this.nodeUrl = syncInfoUrl
}
async getDaySummary() {
try {
this.fetchingSummary = true
const endpointLastBlock = `${this.nodeUrl}/blocks/last`;
const resLastBlock = await fetch(endpointLastBlock);
const dataLastBlock = await resLastBlock.json();
const timestampNow = Date.now();
const currentBlockTimestamp = dataLastBlock.timestamp;
const endpointLastBlock = `${this.nodeUrl}/blocks/last`
const resLastBlock = await fetch(endpointLastBlock)
const dataLastBlock = await resLastBlock.json()
const timestampNow = Date.now()
const currentBlockTimestamp = dataLastBlock.timestamp
if (currentBlockTimestamp < timestampNow) {
const diff = timestampNow - currentBlockTimestamp;
const inSeconds = diff / 1000; // millisecs to secs
const inBlocks = inSeconds / 70;
this.blocksBehind = parseInt(inBlocks);
const diff = timestampNow - currentBlockTimestamp
const inSeconds = diff / 1000
const inBlocks = inSeconds / 70
this.blocksBehind = parseInt(inBlocks)
if (inBlocks >= 100) {
this.isBehind = true;
this.isBehind = true
} else {
this.isBehind = false;
this.blocksBehind = 0;
this.isBehind = false
this.blocksBehind = 0
}
} else {
this.blocksBehind = 0;
this.isBehind = false;
this.blocksBehind = 0
this.isBehind = false
}
} catch (error) {} finally {
this.fetchingSummary = false
@ -140,141 +185,76 @@ class SyncIndicator extends connect(store)(LitElement) {
async checkHowManyBlocksBehind() {
try {
this.getDaySummary();
await this.getDaySummary()
this.interval = setInterval(() => {
if(this.fetchingSummary) return
if (this.isBehind === false) {
this.isBehind = null;
clearInterval(this.interval);
this.isBehind = null
clearInterval(this.interval)
}
this.getDaySummary();
}, 20000);
} catch (error) {}
this.getDaySummary()
}, 20000)
} catch (error) {
// ...
}
}
async bootstrap() {
try {
const endpoint = `${this.nodeUrl}/admin/bootstrap/?apiKey=${this.getApiKey()}`
const res = await fetch(endpoint)
const data = await res.json()
if (data === true) {
parentEpml.request('showSnackBar', get('tour.tour22'))
}
} catch (error) {
// ...
}
}
getApiKey() {
const apiNode = store.getState().app.nodeConfig.knownNodes[store.getState().app.nodeConfig.node]
return apiNode.apiKey
}
stateChanged(state) {
this.address = store.getState().app.selectedAddress.address
if(!this.seenWelcomeSync && state.app.nodeStatus && state.app.nodeStatus.syncPercent === 100 && this.hasOpened === false){
if (!this.seenWelcomeSync && state.app.nodeStatus && state.app.nodeStatus.syncPercent === 100 && this.hasOpened === false) {
this.hasOpened = true
this.dispatchEvent(
new CustomEvent('open-welcome-modal-sync', {
bubbles: true,
composed: true,
})
);
)
}
if (
state.app.nodeStatus &&
Object.keys(state.app.nodeStatus).length === 0
) {
if (state.app.nodeStatus && Object.keys(state.app.nodeStatus).length === 0) {
if (this.numberOfTries > 5) {
this.hasCoreRunning = false;
this.hasCoreRunning = false
} else {
this.numberOfTries = this.numberOfTries + 1;
this.numberOfTries = this.numberOfTries + 1
}
} else if(state.app.nodeStatus && state.app.nodeStatus.syncPercent === 100 && state.app.nodeStatus.syncPercent !== this.syncPercentage){
this.syncPercentage = state.app.nodeStatus.syncPercent;
this.isSynchronizing = false;
} else if (
state.app.nodeStatus
) {
} else if (state.app.nodeStatus && state.app.nodeStatus.syncPercent === 100 && state.app.nodeStatus.syncPercent !== this.syncPercentage) {
this.syncPercentage = state.app.nodeStatus.syncPercent
this.isSynchronizing = false
} else if (state.app.nodeStatus) {
this.hasCoreRunning = true
this.numberOfTries = 0
this.syncPercentage = state.app.nodeStatus.syncPercent;
this.syncPercentage = state.app.nodeStatus.syncPercent
if (state.app.nodeStatus.syncPercent !== 100) {
this.isSynchronizing = true;
}
if (
!this.interval &&
this.isBehind === null &&
state.app.nodeStatus.isSynchronizing &&
state.app.nodeStatus.syncPercent !== 100
) {
this.checkHowManyBlocksBehind();
this.isSynchronizing = true
}
if (!this.interval && this.isBehind === null && state.app.nodeStatus.isSynchronizing && state.app.nodeStatus.syncPercent !== 100) {
this.checkHowManyBlocksBehind()
}
} else {
this.hasCoreRunning = true;
this.hasCoreRunning = true
}
}
async bootstrap(){
try {
const endpoint = `${this.nodeUrl}/admin/bootstrap/?apiKey=${this.myNode.apiKey}`;
const res = await fetch(endpoint);
const data = await res.json();
if(data === true){
parentEpml.request('showSnackBar', get('tour.tour22'));
}
} catch (error) {
}
}
render() {
return html`
${!this.hasCoreRunning
? html`
<div class="parent">
<span
><mwc-icon
id="notification-general-icon"
style="color: red; cursor:pointer;user-select:none"
>priority_high</mwc-icon
></span
>
<p>
${translate("tour.tour17")}
</p>
</div>
`
: (this.blocksBehind > 1050 && this.isSynchronizing)
? html`
<div class="parent">
<div class="column">
<div class="row">
<span
><img
src="/img/syncing.png"
style="height: 24px; width: 24px;"
/></span>
<p>
${this.blocksBehind} ${translate("tour.tour20")}
</p>
</div>
<div
class="row"
style="justify-content: center"
>
<button
class="bootstrap-button"
@click="${() => {
this.bootstrap()
}}"
>
${translate("tour.tour18")}
</button>
</div>
</div>
</div>
`
: this.isSynchronizing
? html`
<div class="parent">
<span
><img
src="/img/syncing.png"
style="height: 24px; width: 24px;"
/></span>
<p>
${translate("tour.tour19")} ${this.blocksBehind ? this.blocksBehind : ""} ${this.blocksBehind ? translate("tour.tour21"): ""}
</p>
</div>
`
: "" }
`;
}
}
customElements.define('sync-indicator', SyncIndicator);
customElements.define('sync-indicator', SyncIndicator)

View File

@ -1,16 +1,17 @@
import { LitElement, html, css } from 'lit';
import { driver } from 'driver.js';
import {css, html, LitElement} from 'lit';
import {driver} from 'driver.js';
import 'driver.js/dist/driver.css';
import '@material/mwc-icon';
import '@polymer/paper-spinner/paper-spinner-lite.js';
import '@vaadin/tooltip';
import '@material/mwc-button';
import { get, translate } from '../../../translate/index.js';
import {get, translate} from '../../../translate';
import '@polymer/paper-dialog/paper-dialog.js';
import { setNewTab } from '../../redux/app/app-actions.js';
import { store } from '../../store.js';
import { connect } from 'pwa-helpers';
import {setNewTab} from '../../redux/app/app-actions.js';
import {store} from '../../store.js';
import {connect} from 'pwa-helpers';
import './tour.css';
class TourComponent extends connect(store)(LitElement) {
static get properties() {
return {
@ -116,7 +117,7 @@ class TourComponent extends connect(store)(LitElement) {
_controlOpenWelcomeModal() {
this.isSynced = true
const seenWelcomeSync = JSON.parse(
localStorage.getItem('welcome-sync') || 'false'
);
@ -175,19 +176,14 @@ class TourComponent extends connect(store)(LitElement) {
const myNode =
window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
window.parent.reduxStore.getState().app.nodeConfig.node
];
]
const nodeUrl =
myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
return nodeUrl;
return myNode.protocol + '://' + myNode.domain + ':' + myNode.port
}
getMyNode() {
const myNode =
window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
window.parent.reduxStore.getState().app.nodeConfig.node
];
return myNode;
return window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
window.parent.reduxStore.getState().app.nodeConfig.node
]
}
async getName(recipient) {
@ -280,7 +276,7 @@ class TourComponent extends connect(store)(LitElement) {
<span><img src="/img/syncing.png" style="height: 24px; width: 24px; padding-top: 4px;" /></span>
<p style="margin:0px;padding:0px">${get("tour.tour4")}</p>
</div>
`,
},
});
@ -397,7 +393,7 @@ class TourComponent extends connect(store)(LitElement) {
class="close-button"
@click=${()=> {
this.onClose()
}}
>
${translate("general.close")}

View File

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

View File

@ -27,19 +27,14 @@ class CoinBalancesController extends connect(store)(LitElement) {
const myNode =
store.getState().app.nodeConfig.knownNodes[
store.getState().app.nodeConfig.node
];
]
const nodeUrl =
myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
return nodeUrl;
return myNode.protocol + '://' + myNode.domain + ':' + myNode.port
}
getMyNode() {
const myNode =
store.getState().app.nodeConfig.knownNodes[
store.getState().app.nodeConfig.node
];
return myNode;
return store.getState().app.nodeConfig.knownNodes[
store.getState().app.nodeConfig.node
]
}

View File

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

View File

@ -1,5 +1,5 @@
import {css, html, LitElement} from 'lit';
import {translate,} from '../../../translate/index.js'
import {translate,} from '../../../translate'
import '@material/mwc-button';
import '@material/mwc-dialog';
import '@material/mwc-checkbox';
@ -202,17 +202,12 @@ class AddFriendsModal extends connect(store)(LitElement) {
window.parent.reduxStore.getState().app.nodeConfig.node
];
const nodeUrl =
myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
return nodeUrl;
return myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
}
getMyNode() {
const myNode =
store.getState().app.nodeConfig.knownNodes[
window.parent.reduxStore.getState().app.nodeConfig.node
return store.getState().app.nodeConfig.knownNodes[
window.parent.reduxStore.getState().app.nodeConfig.node
];
return myNode;
}
clearFields() {
@ -267,7 +262,7 @@ class AddFriendsModal extends connect(store)(LitElement) {
changedProperties &&
changedProperties.has('isOpen') && this.isOpen
) {
this.getAvailableFeedSchemas()
await this.getAvailableFeedSchemas()
}
}
@ -281,11 +276,9 @@ class AddFriendsModal extends connect(store)(LitElement) {
if (data.error === 401) {
this.availableFeeedSchemas = [];
} else {
const result = data.filter(
this.availableFeeedSchemas = data.filter(
(item) => item.identifier === 'ui_schema_feed'
);
this.availableFeeedSchemas = result;
}
this.userFoundModalOpen = true;
} catch (error) {} finally {

View File

@ -1,13 +1,11 @@
import { LitElement, html, css } from 'lit';
import { get, translate } from '../../../translate/index.js'
import {css, html, LitElement} from 'lit';
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 ShortUniqueId from 'short-unique-id';
const requestQueue = new RequestQueueWithPromise(3);
@ -125,17 +123,12 @@ export class AvatarComponent extends connect(store)(LitElement) {
window.parent.reduxStore.getState().app.nodeConfig.node
];
const nodeUrl =
myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
return nodeUrl;
return myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
}
getMyNode() {
const myNode =
window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
window.parent.reduxStore.getState().app.nodeConfig.node
return window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
window.parent.reduxStore.getState().app.nodeConfig.node
];
return myNode;
}
getApiKey() {
@ -143,8 +136,7 @@ export class AvatarComponent extends connect(store)(LitElement) {
window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
window.parent.reduxStore.getState().app.nodeConfig.node
];
let apiKey = myNode.apiKey;
return apiKey;
return myNode.apiKey;
}
async fetchResource() {
@ -161,7 +153,7 @@ export class AvatarComponent extends connect(store)(LitElement) {
}
async fetchVideoUrl() {
this.fetchResource();
await this.fetchResource();
}
async getRawData() {
@ -249,7 +241,7 @@ export class AvatarComponent extends connect(store)(LitElement) {
this.status = res;
if (this.status.status === 'DOWNLOADED') {
this.fetchResource();
await this.fetchResource();
}
}
@ -264,8 +256,8 @@ export class AvatarComponent extends connect(store)(LitElement) {
async _fetchImage() {
try {
this.fetchVideoUrl();
this.fetchStatus();
await this.fetchVideoUrl();
await this.fetchStatus();
} catch (error) {
/* empty */
}

View File

@ -1,15 +1,14 @@
import { css, html, LitElement } 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 {store} from '../../store.js';
import {setNewTab} from '../../redux/app/app-actions.js';
import '@material/mwc-icon';
import { get, translate } from '../../../translate/index.js';
import { repeat } from 'lit/directives/repeat.js';
import {get} from '../../../translate';
import '../../../../plugins/plugins/core/components/TimeAgo.js';
import '../notification-view/popover.js';
import ShortUniqueId from 'short-unique-id';
@ -74,17 +73,12 @@ class BeginnerChecklist extends connect(store)(LitElement) {
window.parent.reduxStore.getState().app.nodeConfig.node
];
const nodeUrl =
myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
return nodeUrl;
return myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
}
getMyNode() {
const myNode =
window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
window.parent.reduxStore.getState().app.nodeConfig.node
return window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
window.parent.reduxStore.getState().app.nodeConfig.node
];
return myNode;
}
async getName(recipient) {
@ -94,11 +88,7 @@ class BeginnerChecklist extends connect(store)(LitElement) {
const res = await fetch(endpoint);
const getNames = await res.json();
if (Array.isArray(getNames) && getNames.length > 0) {
this.hasName = true;
} else {
this.hasName = false;
}
this.hasName = Array.isArray(getNames) && getNames.length > 0;
} catch (error) {
return '';
}
@ -132,7 +122,7 @@ class BeginnerChecklist extends connect(store)(LitElement) {
state.app.accountInfo.names.length > 0
) {
this.hasName = true;
}
}
}
handleBlur() {

View File

@ -1,128 +1,150 @@
import {css, html, LitElement} from 'lit'
import {store} from '../../store'
import {connect} from 'pwa-helpers'
import {translate} from '../../../translate/index.js'
import {translate} from '../../../translate'
class CoreSyncStatus extends connect(store)(LitElement) {
static get properties() {
return {
nodeStatus: {type: Object},
coreInfos: { type: Array }
nodeInfos: { type: Array },
coreInfos: { type: Array },
theme: { type: String, reflect: true }
}
}
constructor() {
super()
this.nodeStatus = {}
this.nodeInfos = []
this.coreInfos = []
this.theme = localStorage.getItem('qortalTheme') ? localStorage.getItem('qortalTheme') : 'light'
}
static styles = css`
.lineHeight {
line-height: 33%;
}
static get styles() {
return css`
.lineHeight {
line-height: 33%;
}
.tooltip {
display: inline-block;
position: relative;
text-align: left;
}
.tooltip {
display: inline-block;
position: relative;
text-align: left;
}
.tooltip .bottom {
min-width: 200px;
max-width: 250px;
top: 35px;
left: 50%;
transform: translate(-50%, 0);
padding: 10px 10px;
color: var(--black);
background-color: var(--white);
font-weight: normal;
font-size: 13px;
border-radius: 8px;
position: absolute;
z-index: 99999999;
box-sizing: border-box;
box-shadow: 0 1px 8px rgba(0,0,0,0.5);
border: 1px solid var(--black);
visibility: hidden;
opacity: 0;
transition: opacity 0.8s;
}
.tooltip .bottom {
min-width: 200px;
max-width: 250px;
top: 35px;
left: 50%;
transform: translate(-50%, 0);
padding: 10px 10px;
color: var(--black);
background-color: var(--white);
font-weight: normal;
font-size: 13px;
border-radius: 8px;
position: absolute;
z-index: 99999999;
box-sizing: border-box;
box-shadow: 0 1px 8px rgba(0,0,0,0.5);
border: 1px solid var(--black);
visibility: hidden;
opacity: 0;
transition: opacity 0.8s;
}
.tooltip:hover .bottom {
visibility: visible;
opacity: 1;
}
.tooltip:hover .bottom {
visibility: visible;
opacity: 1;
}
.tooltip .bottom i {
position: absolute;
bottom: 100%;
left: 50%;
margin-left: -12px;
width: 24px;
height: 12px;
overflow: hidden;
}
.tooltip .bottom i {
position: absolute;
bottom: 100%;
left: 50%;
margin-left: -12px;
width: 24px;
height: 12px;
overflow: hidden;
}
.tooltip .bottom i::after {
content: '';
position: absolute;
width: 12px;
height: 12px;
left: 50%;
transform: translate(-50%,50%) rotate(45deg);
background-color: var(--white);
border: 1px solid var(--black);
box-shadow: 0 1px 8px rgba(0,0,0,0.5);
}
`
.tooltip .bottom i::after {
content: '';
position: absolute;
width: 12px;
height: 12px;
left: 50%;
transform: translate(-50%,50%) rotate(45deg);
background-color: var(--white);
border: 1px solid var(--black);
box-shadow: 0 1px 8px rgba(0,0,0,0.5);
}
`
}
render() {
return html`
<div id="core-sync-status-id">
${this.renderSyncStatusIcon()}
${this.renderSyncStatusIcon()}
</div>
`
}
firstUpdated() {
this.getNodeInfos()
this.getCoreInfos()
setInterval(() => {
this.getNodeInfos()
this.getCoreInfos()
}, 60000)
}, 30000)
}
async getNodeInfos() {
const appInfoNode = store.getState().app.nodeConfig.knownNodes[store.getState().app.nodeConfig.node]
const appInfoUrl = appInfoNode.protocol + '://' + appInfoNode.domain + ':' + appInfoNode.port
const nodeInfoUrl = `${appInfoUrl}/admin/status`
await fetch(nodeInfoUrl).then(response => {
return response.json()
}).then(data => {
this.nodeInfos = data
}).catch(err => {
console.error('Request failed', err)
})
}
async getCoreInfos() {
const corInfo = store.getState().app.nodeConfig.knownNodes[store.getState().app.nodeConfig.node]
const coreInfoUrl = corInfo.protocol + '://' + corInfo.domain + ':' + corInfo.port
const infoUrl = `${coreInfoUrl}/admin/info`
await fetch(infoUrl).then(response => {
const appCoreNode = store.getState().app.nodeConfig.knownNodes[store.getState().app.nodeConfig.node]
const appCoreUrl = appCoreNode.protocol + '://' + appCoreNode.domain + ':' + appCoreNode.port
const coreInfoUrl = `${appCoreUrl}/admin/info`
await fetch(coreInfoUrl).then(response => {
return response.json()
}).then(data => {
this.coreInfos = data
}).catch(err => {
console.error('Request failed', err)
})
}
renderSyncStatusIcon() {
if (this.nodeStatus.isSynchronizing === true && this.nodeStatus.syncPercent === 99) {
if (this.nodeInfos.isSynchronizing === true && this.nodeInfos.syncPercent === 99) {
return html`
<div class="tooltip" style="display: inline;">
<span><img src="/img/syncing.png" style="height: 24px; width: 24px; padding-top: 4px;"></span>
<div class="bottom">
<h3>${translate("walletprofile.wp3")}</h3>
<h4 class="lineHeight">${translate("appinfo.coreversion")}: <span style="color: #03a9f4">${this.coreInfos.buildVersion ? (this.coreInfos.buildVersion).substring(0,12) : ''}</span></h4>
<h4 class="lineHeight">${translate("appinfo.synchronizing")}... <span style="color: #03a9f4">${this.nodeStatus.syncPercent !== undefined ? this.nodeStatus.syncPercent + '%' : ''}</span></h4>
<h4 class="lineHeight">${translate("appinfo.blockheight")}: <span style="color: #03a9f4">${this.nodeStatus.height ? this.nodeStatus.height : ''}</span></h4>
<h4 class="lineHeight">${translate("appinfo.peers")}: <span style="color: #03a9f4">${this.nodeStatus.numberOfConnections ? this.nodeStatus.numberOfConnections : ''}</span></h4>
<h4 class="lineHeight">${translate("appinfo.synchronizing")}... <span style="color: #03a9f4">${this.nodeInfos.syncPercent !== undefined ? this.nodeInfos.syncPercent + '%' : ''}</span></h4>
<h4 class="lineHeight">${translate("appinfo.blockheight")}: <span style="color: #03a9f4">${this.nodeInfos.height ? this.nodeInfos.height : ''}</span></h4>
<h4 class="lineHeight">${translate("appinfo.peers")}: <span style="color: #03a9f4">${this.nodeInfos.numberOfConnections ? this.nodeInfos.numberOfConnections : ''}</span></h4>
<i></i>
</div>
</div>
`
} else if (this.nodeStatus.isSynchronizing === true && this.nodeStatus.isMintingPossible === false && this.nodeStatus.syncPercent === 100) {
} else if (this.nodeInfos.isSynchronizing === true && this.nodeInfos.isMintingPossible === false && this.nodeInfos.syncPercent === 100) {
return html`
<div class="tooltip" style="display: inline;">
<span><img src="/img/synced.png" style="height: 24px; width: 24px; padding-top: 4px;"></span>
@ -130,13 +152,13 @@ class CoreSyncStatus extends connect(store)(LitElement) {
<h3>${translate("walletprofile.wp3")}</h3>
<h4 class="lineHeight">${translate("appinfo.coreversion")}: <span style="color: #03a9f4">${this.coreInfos.buildVersion ? (this.coreInfos.buildVersion).substring(0,12) : ''}</span></h4>
<h4 class="lineHeight">${translate("walletprofile.wp4")} ${translate("walletprofile.wp2")}</h4>
<h4 class="lineHeight">${translate("appinfo.blockheight")}: <span style="color: #03a9f4">${this.nodeStatus.height ? this.nodeStatus.height : ''}</span></h4>
<h4 class="lineHeight">${translate("appinfo.peers")}: <span style="color: #03a9f4">${this.nodeStatus.numberOfConnections ? this.nodeStatus.numberOfConnections : ''}</span></h4>
<h4 class="lineHeight">${translate("appinfo.blockheight")}: <span style="color: #03a9f4">${this.nodeInfos.height ? this.nodeInfos.height : ''}</span></h4>
<h4 class="lineHeight">${translate("appinfo.peers")}: <span style="color: #03a9f4">${this.nodeInfos.numberOfConnections ? this.nodeInfos.numberOfConnections : ''}</span></h4>
<i></i>
</div>
</div>
`
} else if (this.nodeStatus.isSynchronizing === false && this.nodeStatus.isMintingPossible === false && this.nodeStatus.syncPercent === 100) {
} else if (this.nodeInfos.isSynchronizing === false && this.nodeInfos.isMintingPossible === false && this.nodeInfos.syncPercent === 100) {
return html`
<div class="tooltip" style="display: inline;">
<span><img src="/img/synced.png" style="height: 24px; width: 24px; padding-top: 4px;"></span>
@ -144,13 +166,13 @@ class CoreSyncStatus extends connect(store)(LitElement) {
<h3>${translate("walletprofile.wp3")}</h3>
<h4 class="lineHeight">${translate("appinfo.coreversion")}: <span style="color: #03a9f4">${this.coreInfos.buildVersion ? (this.coreInfos.buildVersion).substring(0,12) : ''}</span></h4>
<h4 class="lineHeight">${translate("walletprofile.wp4")} ${translate("walletprofile.wp2")}</h4>
<h4 class="lineHeight">${translate("appinfo.blockheight")}: <span style="color: #03a9f4">${this.nodeStatus.height ? this.nodeStatus.height : ''}</span></h4>
<h4 class="lineHeight">${translate("appinfo.peers")}: <span style="color: #03a9f4">${this.nodeStatus.numberOfConnections ? this.nodeStatus.numberOfConnections : ''}</span></h4>
<h4 class="lineHeight">${translate("appinfo.blockheight")}: <span style="color: #03a9f4">${this.nodeInfos.height ? this.nodeInfos.height : ''}</span></h4>
<h4 class="lineHeight">${translate("appinfo.peers")}: <span style="color: #03a9f4">${this.nodeInfos.numberOfConnections ? this.nodeInfos.numberOfConnections : ''}</span></h4>
<i></i>
</div>
</div>
`
} else if (this.nodeStatus.isSynchronizing === true && this.nodeStatus.isMintingPossible === true && this.nodeStatus.syncPercent === 100) {
} else if (this.nodeInfos.isSynchronizing === true && this.nodeInfos.isMintingPossible === true && this.nodeInfos.syncPercent === 100) {
return html`
<div class="tooltip" style="display: inline;">
<span><img src="/img/synced_minting.png" style="height: 24px; width: 24px; padding-top: 4px;"></span>
@ -158,13 +180,13 @@ class CoreSyncStatus extends connect(store)(LitElement) {
<h3>${translate("walletprofile.wp3")}</h3>
<h4 class="lineHeight">${translate("appinfo.coreversion")}: <span style="color: #03a9f4">${this.coreInfos.buildVersion ? (this.coreInfos.buildVersion).substring(0,12) : ''}</span></h4>
<h4 class="lineHeight">${translate("walletprofile.wp4")} <span style="color: #03a9f4">( ${translate("walletprofile.wp1")} )</span></h4>
<h4 class="lineHeight">${translate("appinfo.blockheight")}: <span style="color: #03a9f4">${this.nodeStatus.height ? this.nodeStatus.height : ''}</span></h4>
<h4 class="lineHeight">${translate("appinfo.peers")}: <span style="color: #03a9f4">${this.nodeStatus.numberOfConnections ? this.nodeStatus.numberOfConnections : ''}</span></h4>
<h4 class="lineHeight">${translate("appinfo.blockheight")}: <span style="color: #03a9f4">${this.nodeInfos.height ? this.nodeInfos.height : ''}</span></h4>
<h4 class="lineHeight">${translate("appinfo.peers")}: <span style="color: #03a9f4">${this.nodeInfos.numberOfConnections ? this.nodeInfos.numberOfConnections : ''}</span></h4>
<i></i>
</div>
</div>
`
} else if (this.nodeStatus.isSynchronizing === false && this.nodeStatus.isMintingPossible === true && this.nodeStatus.syncPercent === 100) {
} else if (this.nodeInfos.isSynchronizing === false && this.nodeInfos.isMintingPossible === true && this.nodeInfos.syncPercent === 100) {
return html`
<div class="tooltip" style="display: inline;">
<span><img src="/img/synced_minting.png" style="height: 24px; width: 24px; padding-top: 4px;"></span>
@ -172,8 +194,8 @@ class CoreSyncStatus extends connect(store)(LitElement) {
<h3>${translate("walletprofile.wp3")}</h3>
<h4 class="lineHeight">${translate("appinfo.coreversion")}: <span style="color: #03a9f4">${this.coreInfos.buildVersion ? (this.coreInfos.buildVersion).substring(0,12) : ''}</span></h4>
<h4 class="lineHeight">${translate("walletprofile.wp4")} <span style="color: #03a9f4">( ${translate("walletprofile.wp1")} )</span></h4>
<h4 class="lineHeight">${translate("appinfo.blockheight")}: <span style="color: #03a9f4">${this.nodeStatus.height ? this.nodeStatus.height : ''}</span></h4>
<h4 class="lineHeight">${translate("appinfo.peers")}: <span style="color: #03a9f4">${this.nodeStatus.numberOfConnections ? this.nodeStatus.numberOfConnections : ''}</span></h4>
<h4 class="lineHeight">${translate("appinfo.blockheight")}: <span style="color: #03a9f4">${this.nodeInfos.height ? this.nodeInfos.height : ''}</span></h4>
<h4 class="lineHeight">${translate("appinfo.peers")}: <span style="color: #03a9f4">${this.nodeInfos.numberOfConnections ? this.nodeInfos.numberOfConnections : ''}</span></h4>
<i></i>
</div>
</div>
@ -185,9 +207,9 @@ class CoreSyncStatus extends connect(store)(LitElement) {
<div class="bottom">
<h3>${translate("walletprofile.wp3")}</h3>
<h4 class="lineHeight">${translate("appinfo.coreversion")}: <span style="color: #03a9f4">${this.coreInfos.buildVersion ? (this.coreInfos.buildVersion).substring(0,12) : ''}</span></h4>
<h4 class="lineHeight">${translate("appinfo.synchronizing")}... <span style="color: #03a9f4">${this.nodeStatus.syncPercent !== undefined ? this.nodeStatus.syncPercent + '%' : ''}</span></h4>
<h4 class="lineHeight">${translate("appinfo.blockheight")}: <span style="color: #03a9f4">${this.nodeStatus.height ? this.nodeStatus.height : ''}</span></h4>
<h4 class="lineHeight">${translate("appinfo.peers")}: <span style="color: #03a9f4">${this.nodeStatus.numberOfConnections ? this.nodeStatus.numberOfConnections : ''}</span></h4>
<h4 class="lineHeight">${translate("appinfo.synchronizing")}... <span style="color: #03a9f4">${this.nodeInfos.syncPercent !== undefined ? this.nodeInfos.syncPercent + '%' : ''}</span></h4>
<h4 class="lineHeight">${translate("appinfo.blockheight")}: <span style="color: #03a9f4">${this.nodeInfos.height ? this.nodeInfos.height : ''}</span></h4>
<h4 class="lineHeight">${translate("appinfo.peers")}: <span style="color: #03a9f4">${this.nodeInfos.numberOfConnections ? this.nodeInfos.numberOfConnections : ''}</span></h4>
<i></i>
</div>
</div>
@ -196,7 +218,7 @@ class CoreSyncStatus extends connect(store)(LitElement) {
}
stateChanged(state) {
this.nodeStatus = state.app.nodeStatus
// ...
}
}

View File

@ -1,5 +1,5 @@
import {css, html, LitElement} from 'lit';
import {translate,} from '../../../translate/index.js'
import {translate,} from '../../../translate'
import axios from 'axios'
import '@material/mwc-menu';
import '@material/mwc-list/mwc-list-item.js'
@ -174,13 +174,10 @@ export class FeedItem extends connect(store)(LitElement) {
getNodeUrl(){
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
const nodeUrl = myNode.protocol + '://' + myNode.domain + ':' + myNode.port
return nodeUrl
return myNode.protocol + '://' + myNode.domain + ':' + myNode.port
}
getMyNode(){
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
return myNode
return window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
}
getApiKey() {
@ -188,8 +185,7 @@ getMyNode(){
window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
window.parent.reduxStore.getState().app.nodeConfig.node
];
let apiKey = myNode.apiKey;
return apiKey;
return myNode.apiKey;
}
async fetchResource() {
@ -206,7 +202,7 @@ getMyNode(){
async fetchVideoUrl() {
this.fetchResource()
await this.fetchResource()
}
@ -311,7 +307,7 @@ getMyNode(){
this.status = res
if(this.status.status === 'DOWNLOADED'){
this.fetchResource()
await this.fetchResource()
}
}
@ -332,8 +328,8 @@ getMyNode(){
async _fetchImage() {
try {
this.fetchVideoUrl()
this.fetchStatus()
await this.fetchVideoUrl()
await this.fetchStatus()
} catch (error) { /* empty */ }
}

View File

@ -1,11 +1,11 @@
// popover-component.js
import { css, html, LitElement } from 'lit';
import { createPopper } from '@popperjs/core';
import {css, html, LitElement} from 'lit';
import {createPopper} from '@popperjs/core';
import '@material/mwc-icon';
import { translate } from '../../../translate/index.js'
import { store } from '../../store';
import { connect } from 'pwa-helpers';
import { setNewTab, setSideEffectAction } from '../../redux/app/app-actions';
import {translate} from '../../../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) {
@ -79,11 +79,9 @@ export class FriendItemActions extends connect(store)(LitElement) {
const myNode =
store.getState().app.nodeConfig.knownNodes[
window.parent.reduxStore.getState().app.nodeConfig.node
];
]
const nodeUrl =
myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
return nodeUrl;
return myNode.protocol + '://' + myNode.domain + ':' + myNode.port
}
firstUpdated() {

View File

@ -5,7 +5,7 @@ import {friendsViewStyles} from './friends-view-css';
import {connect} from 'pwa-helpers';
import {store} from '../../store';
import './feed-item'
import {translate} from '../../../translate/index.js'
import {translate} from '../../../translate'
import '@polymer/paper-spinner/paper-spinner-lite.js'
@ -53,24 +53,18 @@ class FriendsFeed extends connect(store)(LitElement) {
const myNode =
store.getState().app.nodeConfig.knownNodes[
window.parent.reduxStore.getState().app.nodeConfig.node
];
]
const nodeUrl =
myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
return nodeUrl;
return myNode.protocol + '://' + myNode.domain + ':' + myNode.port
}
getMyNode() {
const myNode =
store.getState().app.nodeConfig.knownNodes[
window.parent.reduxStore.getState().app.nodeConfig.node
];
return myNode;
return store.getState().app.nodeConfig.knownNodes[
window.parent.reduxStore.getState().app.nodeConfig.node
]
}
_updateFeeds(event) {
const detail = event.detail
this.mySelectedFeeds = detail
this.mySelectedFeeds = event.detail
this.reFetchFeedData()
this.requestUpdate()
}
@ -170,7 +164,7 @@ class FriendsFeed extends connect(store)(LitElement) {
if(this.mySelectedFeeds.length === 0){
await this.getEndpoints()
this.loadAndMergeData();
await this.loadAndMergeData();
}
this.getFeedOnInterval()
@ -190,7 +184,7 @@ this.getFeedOnInterval()
async refresh(){
try {
await this.getEndpoints()
this.reFetchFeedData()
await this.reFetchFeedData()
} catch (error) {
}
@ -216,7 +210,7 @@ this.getFeedOnInterval()
observerHandler(entries) {
if (!entries[0].isIntersecting) {
return;
} else {
if (this.feedToRender.length < 20) {
return;
@ -326,8 +320,7 @@ this.getFeedOnInterval()
let clickValue1 = newItem.schema.click;
const resolvedClickValue1 = replacePlaceholders(clickValue1, resource, newItem.schema.customParams);
newItem.link = resolvedClickValue1
newItem.link = replacePlaceholders(clickValue1, resource, newItem.schema.customParams)
newData.push(newItem)
}
}
@ -375,7 +368,7 @@ this.getFeedOnInterval()
return false;
});
}
async loadAndMergeData() {
let allData = this.feed

View File

@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit'
import '@material/mwc-icon'
import './friends-side-panel.js'
import '@vaadin/tooltip'
import {translate} from '../../../translate/index.js'
import {translate} from '../../../translate'
class FriendsSidePanelParent extends LitElement {
static get properties() {

View File

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

View File

@ -13,7 +13,7 @@ import './ChatSideNavHeads';
import '../../../../plugins/plugins/core/components/ChatSearchResults'
import './add-friends-modal'
import {translate,} from '../../../translate/index.js'
import {translate,} from '../../../translate'
import {store} from '../../store';
import {friendsViewStyles} from './friends-view-css';
import {parentEpml} from '../show-plugin';
@ -74,19 +74,14 @@ class FriendsView extends connect(store)(LitElement) {
const myNode =
store.getState().app.nodeConfig.knownNodes[
window.parent.reduxStore.getState().app.nodeConfig.node
];
]
const nodeUrl =
myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
return nodeUrl;
return myNode.protocol + '://' + myNode.domain + ':' + myNode.port
}
getMyNode() {
const myNode =
store.getState().app.nodeConfig.knownNodes[
window.parent.reduxStore.getState().app.nodeConfig.node
];
return myNode;
return store.getState().app.nodeConfig.knownNodes[
window.parent.reduxStore.getState().app.nodeConfig.node
]
}
getMoreFriends() {}
@ -105,12 +100,10 @@ class FriendsView extends connect(store)(LitElement) {
}
_updateFriends(event) {
const detail = event.detail
this.friendList = detail
this.friendList = event.detail
}
_updateFeed(event) {
const detail = event.detail
this.mySelectedFeeds = detail
this.mySelectedFeeds = event.detail
this.requestUpdate()
}
_addFriend(event){
@ -125,7 +118,7 @@ class FriendsView extends connect(store)(LitElement) {
name
};
}
this.isOpenAddFriendsModal = true
this.openSidePanel()
}
@ -165,7 +158,7 @@ class FriendsView extends connect(store)(LitElement) {
observerHandler(entries) {
if (!entries[0].isIntersecting) {
return;
} else {
if (this.friendList.length < 20) {
return;
@ -201,8 +194,7 @@ class FriendsView extends connect(store)(LitElement) {
getApiKey() {
const apiNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
let apiKey = apiNode.apiKey
return apiKey
return apiNode.apiKey
}
async myFollowName(name) {
@ -211,7 +203,7 @@ class FriendsView extends connect(store)(LitElement) {
]
let namesJsonString = JSON.stringify({ "items": items })
let ret = await parentEpml.request('apiCall', {
return await parentEpml.request('apiCall', {
url: `/lists/followedNames?apiKey=${this.getApiKey()}`,
method: 'POST',
headers: {
@ -219,9 +211,6 @@ class FriendsView extends connect(store)(LitElement) {
},
body: `${namesJsonString}`
})
return ret
}
async unFollowName(name) {
@ -230,7 +219,7 @@ class FriendsView extends connect(store)(LitElement) {
]
let namesJsonString = JSON.stringify({ "items": items })
let ret = await parentEpml.request('apiCall', {
return await parentEpml.request('apiCall', {
url: `/lists/followedNames?apiKey=${this.getApiKey()}`,
method: 'DELETE',
headers: {
@ -238,9 +227,6 @@ class FriendsView extends connect(store)(LitElement) {
},
body: `${namesJsonString}`
})
return ret
}
async addToFriendList(val, isRemove){
const copyVal = {...val}
@ -260,9 +246,9 @@ class FriendsView extends connect(store)(LitElement) {
this.friendList = [...this.friendList, copyVal]
}
if(!copyVal.willFollow || isRemove) {
this.unFollowName(copyVal.name)
await this.unFollowName(copyVal.name)
} else if(copyVal.willFollow){
this.myFollowName(copyVal.name)
await this.myFollowName(copyVal.name)
}
this.setMySelectedFeeds(val.mySelectedFeeds)
await new Promise((res)=> {

View File

@ -1,15 +1,14 @@
import { LitElement, html, css } from 'lit';
import { render } from 'lit/html.js';
import { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from '../../../translate/index.js'
import {css, html, LitElement} from 'lit';
import {get, translate} from '../../../translate'
import '@material/mwc-button';
import '@material/mwc-icon';
import '@vaadin/tooltip';
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';
import { parentEpml } from '../show-plugin';
import {parentEpml} from '../show-plugin';
class ProfileModalUpdate extends connect(store)(LitElement) {
static get properties() {
@ -274,7 +273,7 @@ class ProfileModalUpdate extends connect(store)(LitElement) {
this.requestUpdate();
}
}
async firstUpdated() {
@ -335,19 +334,14 @@ class ProfileModalUpdate extends connect(store)(LitElement) {
const myNode =
store.getState().app.nodeConfig.knownNodes[
window.parent.reduxStore.getState().app.nodeConfig.node
];
]
const nodeUrl =
myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
return nodeUrl;
return myNode.protocol + '://' + myNode.domain + ':' + myNode.port
}
getMyNode() {
const myNode =
store.getState().app.nodeConfig.knownNodes[
window.parent.reduxStore.getState().app.nodeConfig.node
];
return myNode;
return store.getState().app.nodeConfig.knownNodes[
window.parent.reduxStore.getState().app.nodeConfig.node
]
}
clearFields() {
@ -549,12 +543,12 @@ class ProfileModalUpdate extends connect(store)(LitElement) {
<div
style="display:flex;justify-content:center;flex-direction:column;gap:25px"
>
<div
style="display:flex;gap:15px;align-items:center"
>
<p
style="color: var(--black);font-size:16px"
>
${key}
@ -592,9 +586,9 @@ class ProfileModalUpdate extends connect(store)(LitElement) {
>
${translate('general.close')}
</button>
<div style="display:flex;gap:10px;align-items:center">
<button
?disabled="${this.isLoading}"
class="modal-button"
@ -718,7 +712,7 @@ class ProfileModalUpdate extends connect(store)(LitElement) {
class="input"
.value=${this.newFieldName}
@change=${(e) => {
this.newFieldName = e.target.value
this.newFieldName = e.target.value
}}
/>
<input

View File

@ -1,12 +1,12 @@
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 WebWorker2 from '../WebWorkerFile.js';
import '@polymer/paper-spinner/paper-spinner-lite.js';
import '@vaadin/tooltip';
import { get, translate } from '../../../translate/index.js'
import {get, translate} from '../../../translate'
import ShortUniqueId from 'short-unique-id';
import '@polymer/paper-dialog/paper-dialog.js';
@ -14,20 +14,15 @@ 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';
import './avatar.js';
import {
setNewTab,
setProfileData,
setSideEffectAction,
} from '../../redux/app/app-actions.js';
import {setNewTab, setProfileData, setSideEffectAction,} from '../../redux/app/app-actions.js';
import './profile-modal-update.js';
import { modalHelper } from '../../../../plugins/plugins/utils/publish-modal.js';
import {modalHelper} from '../../../../plugins/plugins/utils/publish-modal.js';
class ProfileQdn extends connect(store)(LitElement) {
static get properties() {
@ -288,19 +283,14 @@ class ProfileQdn extends connect(store)(LitElement) {
const myNode =
window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
window.parent.reduxStore.getState().app.nodeConfig.node
];
]
const nodeUrl =
myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
return nodeUrl;
return myNode.protocol + '://' + myNode.domain + ':' + myNode.port
}
getMyNode() {
const myNode =
window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
window.parent.reduxStore.getState().app.nodeConfig.node
];
return myNode;
return window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
window.parent.reduxStore.getState().app.nodeConfig.node
]
}
async getRawData(dataItem) {
@ -323,10 +313,9 @@ class ProfileQdn extends connect(store)(LitElement) {
}
async followNames(names) {
let items = names;
let namesJsonString = JSON.stringify({ items: items });
let namesJsonString = JSON.stringify({ items: names });
let ret = await parentEpml.request('apiCall', {
return await parentEpml.request('apiCall', {
url: `/lists/followedNames?apiKey=${this.myNode.apiKey}`,
method: 'POST',
headers: {
@ -334,8 +323,6 @@ class ProfileQdn extends connect(store)(LitElement) {
},
body: `${namesJsonString}`,
});
return ret;
}
async setValues(response, resource) {
@ -426,8 +413,7 @@ class ProfileQdn extends connect(store)(LitElement) {
async getProfile() {
try {
this.error = '';
const arbFee = await this.getArbitraryFee();
this.fee = arbFee;
this.fee = await this.getArbitraryFee();
this.hasAttemptedToFetchResource = true;
let resource;
@ -459,7 +445,7 @@ class ProfileQdn extends connect(store)(LitElement) {
try {
const response = await this.getRawData(dataItem);
if (response.wallets) {
this.setValues(response, dataItem);
await this.setValues(response, dataItem);
} else {
this.error = 'Cannot get saved user settings';
}
@ -574,11 +560,10 @@ class ProfileQdn extends connect(store)(LitElement) {
const toBase64 = await objectToBase64(
newObject.customData[key]
);
const encryptedData = encryptDataGroup({
newObject['customData'][key] = encryptDataGroup({
data64: toBase64,
publicKeys: [],
});
newObject['customData'][key] = encryptedData;
}
} else {
newObject['customData'][key] = newObject.customData[key];
@ -814,11 +799,7 @@ class ProfileQdn extends connect(store)(LitElement) {
const findIndex = friendList.findIndex(
(friend) => friend.name === name
);
if (findIndex !== -1) {
this.isFriend = true;
} else {
this.isFriend = false;
}
this.isFriend = findIndex !== -1;
} catch (error) {}
}
render() {

View File

@ -1,17 +1,16 @@
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 '../WebWorkerFile.js';
import '@polymer/paper-spinner/paper-spinner-lite.js';
import '@vaadin/tooltip';
import { get, translate } from '../../../translate/index.js'
import {translate} from '../../../translate'
import ShortUniqueId from 'short-unique-id';
import {
decryptGroupData,
encryptDataGroup,
objectToBase64,
uint8ArrayToObject,
@ -19,7 +18,7 @@ import {
import {publishData} from '../../../../plugins/plugins/utils/publish-image.js';
import {parentEpml} from '../show-plugin.js';
import '../notification-view/popover.js';
import { setNewTab } from '../../redux/app/app-actions.js';
import {setNewTab} from '../../redux/app/app-actions.js';
class SaveSettingsQdn extends connect(store)(LitElement) {
static get properties() {
@ -144,19 +143,14 @@ class SaveSettingsQdn extends connect(store)(LitElement) {
const myNode =
window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
window.parent.reduxStore.getState().app.nodeConfig.node
];
]
const nodeUrl =
myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
return nodeUrl;
return myNode.protocol + '://' + myNode.domain + ':' + myNode.port
}
getMyNode() {
const myNode =
window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
window.parent.reduxStore.getState().app.nodeConfig.node
];
return myNode;
return window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
window.parent.reduxStore.getState().app.nodeConfig.node
]
}
async getRawData(dataItem) {
@ -165,8 +159,7 @@ class SaveSettingsQdn extends connect(store)(LitElement) {
const data = await res.text();
if (data.error) throw new Error('Cannot retrieve your data from qdn');
const decryptedData = decryptGroupData(data);
const decryptedDataToBase64 = uint8ArrayToObject(decryptedData);
return decryptedDataToBase64;
return uint8ArrayToObject(decryptedData);
}
async getMyFollowedNames() {
@ -184,10 +177,9 @@ class SaveSettingsQdn extends connect(store)(LitElement) {
}
async followNames(names) {
let items = names
let namesJsonString = JSON.stringify({ "items": items })
let namesJsonString = JSON.stringify({ "items": names })
let ret = await parentEpml.request('apiCall', {
return await parentEpml.request('apiCall', {
url: `/lists/followedNames?apiKey=${this.myNode.apiKey}`,
method: 'POST',
headers: {
@ -195,9 +187,6 @@ class SaveSettingsQdn extends connect(store)(LitElement) {
},
body: `${namesJsonString}`
})
return ret
}
async setValues(response, resource) {
@ -322,8 +311,7 @@ class SaveSettingsQdn extends connect(store)(LitElement) {
async getGeneralSettingsQdn() {
try {
this.error = ""
const arbFee = await this.getArbitraryFee();
this.fee = arbFee;
this.fee = await this.getArbitraryFee();
this.hasAttemptedToFetchResource = true;
let resource;
let nameObject
@ -331,7 +319,7 @@ class SaveSettingsQdn extends connect(store)(LitElement) {
nameObject = store.getState().app.accountInfo.names[0];
} catch (error) {
}
if (!nameObject) {
this.name = null;
@ -358,7 +346,7 @@ class SaveSettingsQdn extends connect(store)(LitElement) {
try {
const response = await this.getRawData(dataItem);
if (response.version) {
this.setValues(response, dataItem);
await this.setValues(response, dataItem);
} else {
this.error = 'Cannot get saved user settings';
}
@ -514,9 +502,9 @@ class SaveSettingsQdn extends connect(store)(LitElement) {
});
this.resourceExists = true;
this.setValues(newObject, {
updated: Date.now(),
});
await this.setValues(newObject, {
updated: Date.now(),
});
localStorage.setItem('temp-settings-data', JSON.stringify({}));
this.valuesToBeSavedOnQdn = {};
worker.terminate();

View File

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

View File

@ -1,7 +1,7 @@
import {css, html, LitElement} from 'lit'
import {connect} from 'pwa-helpers'
import {store} from '../../store.js'
import {get, translate} from '../../../translate/index.js'
import {get, translate} from '../../../translate'
import {createWallet} from '../../../../crypto/api/createWallet.js'
import {doLogin, doLogout, doSelectAddress} from '../../redux/app/app-actions.js'
@ -593,7 +593,7 @@ class CreateAccountSection extends connect(store)(LitElement) {
const dataString = JSON.stringify(data)
const blob = new Blob([dataString], { type: 'text/plain;charset=utf-8' })
backupname = "qortal_backup_" + wallet.addresses[0].address + ".json"
this.saveFileToDisk(blob, backupname)
await this.saveFileToDisk(blob, backupname)
}
async downloadSeedphrase() {
@ -601,7 +601,7 @@ class CreateAccountSection extends connect(store)(LitElement) {
const seed = this.shadowRoot.getElementById('randSentence').parsedString
const blob = new Blob([seed], { type: 'text/plain;charset=utf-8' })
seedname = "qortal_seedphrase.txt"
this.saveFileToDisk(blob, seedname)
await this.saveFileToDisk(blob, seedname)
}
async saveFileToDisk(blob, fileName) {

View File

@ -2,14 +2,21 @@ import {css, html, LitElement} from 'lit'
import {connect} from 'pwa-helpers'
import {store} from '../../store.js'
import {checkApiKey} from '../../apiKeyUtils.js'
import {translate} from '../../../translate/index.js'
import {translate} from '../../../translate'
import {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'
import '@material/mwc-button'
import '@material/mwc-checkbox'
import '@material/mwc-textfield'
import '@material/mwc-icon'
import '@material/mwc-dialog'
import '@material/mwc-formfield'
import '@material/mwc-icon'
import '@material/mwc-icon-button'
import '@material/mwc-textfield'
import '@polymer/iron-pages'
import '@polymer/paper-input/paper-input-container.js'
import '@polymer/paper-input/paper-input.js'
@ -18,12 +25,6 @@ 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 {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'
class LoginSection extends connect(store)(LitElement) {
static get properties() {
@ -124,15 +125,15 @@ class LoginSection extends connect(store)(LitElement) {
return html`
<style>
#loginSection {
padding:0;
text-align:left;
padding: 0;
text-align: left;
padding-top: 12px;
--paper-spinner-color: var(--mdc-theme-primary);
--paper-spinner-stroke-width: 2px;
}
#loginPages{
overflow:visible;
overflow: visible;
}
#walletsPage {
@ -167,7 +168,7 @@ class LoginSection extends connect(store)(LitElement) {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin:0;
margin: 0;
height: 20px;
font-size: 15px;
line-height: 20px;
@ -213,21 +214,21 @@ class LoginSection extends connect(store)(LitElement) {
}
*[hidden] {
display:none !important;
display: none !important;
visibility: hidden;
}
h1 {
padding: 24px;
padding-top:0;
margin:0;
font-size:24px;
font-weight:100;
padding-top: 0;
margin: 0;
font-size: 24px;
font-weight: 100;
}
.accountIcon {
font-size:42px;
padding-top:8px;
font-size: 42px;
padding-top: 8px;
}
#unlockStoredPage {
@ -241,9 +242,9 @@ class LoginSection extends connect(store)(LitElement) {
@media only screen and (max-width: ${getComputedStyle(document.body).getPropertyValue('--layout-breakpoint-tablet')}) {
/* Mobile */
#wallets {
height:100%;
overflow-y:auto;
overflow-x:hidden;
height: 100%;
overflow-y: auto;
overflow-x: hidden;
}
#loginSection {
@ -256,15 +257,15 @@ class LoginSection extends connect(store)(LitElement) {
}
.backButton {
padding:14px;
text-align:left;
padding: 14px;
text-align: left;
}
#pagesContainer {
max-height: calc(var(--window-height) - 184px);
}
.checkboxLabel:hover{
.checkboxLabel:hover {
cursor: pointer;
}
</style>

View File

@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit'
import {connect} from 'pwa-helpers'
import {store} from '../../store.js'
import {stateAwait} from '../../stateAwait.js'
import {get} from '../../../translate/index.js'
import {get} from '../../../translate'
import '@material/mwc-button'
import '@material/mwc-icon'
@ -22,10 +22,12 @@ import {
allowQAPPAutoAuth,
allowQAPPAutoFriendsList,
allowQAPPAutoLists,
allowShowSyncIndicator,
removeAutoLoadImageChat,
removeQAPPAutoAuth,
removeQAPPAutoFriendsList,
removeQAPPAutoLists,
removeShowSyncIndicator,
setNewNotification,
setNewTab,
setSideEffectAction,
@ -47,7 +49,9 @@ window.reduxAction = {
setNewNotification: setNewNotification,
setSideEffectAction: setSideEffectAction,
allowQAPPAutoFriendsList: allowQAPPAutoFriendsList,
removeQAPPAutoFriendsList: removeQAPPAutoFriendsList
removeQAPPAutoFriendsList: removeQAPPAutoFriendsList,
allowShowSyncIndicator: allowShowSyncIndicator,
removeShowSyncIndicator: removeShowSyncIndicator
}
const animationDuration = 0.7 // Seconds

View File

@ -346,8 +346,7 @@ var pJS = function (tag_id, params) {
var shape_type = pJS.particles.shape.type
if (typeof (shape_type) === 'object') {
if (shape_type instanceof Array) {
var shape_selected = shape_type[Math.floor(Math.random() * shape_type.length)]
this.shape = shape_selected
this.shape = shape_type[Math.floor(Math.random() * shape_type.length)]
}
} else {
this.shape = shape_type
@ -1255,11 +1254,11 @@ function hexToRgb(hex) {
g: parseInt(result[2], 16),
b: parseInt(result[3], 16)
} : null
};
}
function clamp(number, min, max) {
return Math.min(Math.max(number, min), max)
};
}
function isInArray(value, array) {
return array.indexOf(value) > -1

View File

@ -1,5 +1,5 @@
import {css, html, LitElement} from 'lit'
import {translate} from '../../../translate/index.js'
import {translate} from '../../../translate'
import '@material/mwc-button'
@ -13,68 +13,56 @@ class WelcomePage extends LitElement {
backDisabled: { type: Boolean, notify: true },
backText: { type: String, notify: true },
hideNav: { type: Boolean, notify: true },
welcomeMessage: { type: String },
theme: { type: String, reflect: true }
}
}
static get styles() {
return [
css`
* {
--mdc-theme-primary: var(--login-button);
--mdc-theme-secondary: var(--mdc-theme-primary);
--mdc-button-outline-color: var(--accent-color);
}
return css`
* {
--mdc-theme-primary: var(--login-button);
--mdc-theme-secondary: var(--mdc-theme-primary);
--mdc-button-outline-color: var(--general-color-blue);
}
mwc-button {
margin: 6px;
width: 90%;
max-width:90vw;
margin: 4px;
}
.button-outline {
margin: 6px;
width: 90%;
max-width:90vw;
border-top: 0;
border-bottom: 0;
}
.welcome-page {
padding: 12px 0;
}
`
]
.welcome-page {
padding: 12px 0;
overflow: hidden;
}
`
}
constructor() {
super()
this.hideNav = true
this.nextText = ''
const welcomeMessage = 'Welcome to Qortal';
this.welcomeMessage = welcomeMessage
this.welcomeMessage = 'Welcome to Qortal'
this.theme = localStorage.getItem('qortalTheme') ? localStorage.getItem('qortalTheme') : 'light'
}
firstUpdated() {
// ...
}
firstUpdated() {}
render() {
return html`
<style>
#mobile-logo {}
@media only screen and (min-width: ${getComputedStyle(document.body).getPropertyValue('--layout-breakpoint-tablet')}) {
#mobile-logo {
display:hidden;
visibility:none;
}
}
</style>
<div class='welcome-page' style="overflow:hidden;">
<div id="mobile-logo"></div>
<mwc-button @click=${() => this.navigate('login')} outlined style="border-top:0; border-bottom:0;">${translate("login.login")}</mwc-button>
<mwc-button @click=${() => this.navigate('create-account')} outlined style="border-top:0; border-bottom:0;">${translate("login.createaccount")}</mwc-button>
<div class="welcome-page">
<mwc-button class="button-outline" @click=${() => this.navigate('login')} outlined>${translate("login.login")}</mwc-button>
<mwc-button class="button-outline" @click=${() => this.navigate('create-account')} outlined>${translate("login.createaccount")}</mwc-button>
</div>
`
}
back() { }
back() {}
next() { }
next() {}
navigate(page) {
this.dispatchEvent(new CustomEvent('navigate', {

View File

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

View File

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

View File

@ -8,7 +8,7 @@ import '@polymer/iron-icons/iron-icons.js';
import {store} from '../../store.js';
import {setNewNotification} from '../../redux/app/app-actions.js';
import '@material/mwc-icon';
import {get, translate} from '../../../translate/index.js'
import {get, translate} from '../../../translate'
import {repeat} from 'lit/directives/repeat.js';
import '../../../../plugins/plugins/core/components/TimeAgo.js';
import './popover.js';
@ -20,7 +20,6 @@ class NotificationBellGeneral extends connect(store)(LitElement) {
showNotifications: { type: Boolean },
notificationCount: { type: Boolean },
theme: { type: String, reflect: true },
notifications: { type: Array },
currentNotification: { type: Object },
};
@ -294,19 +293,14 @@ class NotificationItemTx extends connect(store)(LitElement) {
const myNode =
store.getState().app.nodeConfig.knownNodes[
window.parent.reduxStore.getState().app.nodeConfig.node
];
]
const nodeUrl =
myNode.protocol + '://' + myNode.domain + ':' + myNode.port;
return nodeUrl;
return myNode.protocol + '://' + myNode.domain + ':' + myNode.port
}
getMyNode() {
const myNode =
store.getState().app.nodeConfig.knownNodes[
window.parent.reduxStore.getState().app.nodeConfig.node
];
return myNode;
return store.getState().app.nodeConfig.knownNodes[
window.parent.reduxStore.getState().app.nodeConfig.node
]
}
async getStatus() {
@ -314,11 +308,10 @@ class NotificationItemTx extends connect(store)(LitElement) {
let stop = false;
const getAnswer = async () => {
const getTx = async (minterAddr) => {
const url = `${this.nodeUrl}/transactions/signature/${this.signature}`;
const res = await fetch(url);
const data = await res.json();
return data;
};
const url = `${this.nodeUrl}/transactions/signature/${this.signature}`
const res = await fetch(url)
return await res.json()
}
if (!stop) {
stop = true;

View File

@ -43,8 +43,7 @@ class NotificationBell extends connect(store)(LitElement) {
getApiKey() {
const apiNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
let apiKey = apiNode.apiKey
return apiKey
return apiNode.apiKey
}
async getNotifications() {
@ -69,8 +68,7 @@ class NotificationBell extends connect(store)(LitElement) {
}
})
const data = await response.json()
return data;
return await response.json()
}
if (!stop && !this.showNotifications) {
@ -97,25 +95,41 @@ class NotificationBell extends connect(store)(LitElement) {
if (!this.initialFetch && notificationsToShow.length > 0) {
const mail = notificationsToShow[0]
const urlPic = `${nodeUrl}/arbitrary/THUMBNAIL/${mail.name}/qortal_avatar?async=true&apiKey=${this.getApiKey()}`
routes.showNotification({
data: { title: "New Q-Mail", type: "qapp", sound: config.messageAlert, url: "", options: { body: `You have an unread mail from ${mail.name}`, icon: urlPic, badge: urlPic } }
await routes.showNotification({
data: {
title: "New Q-Mail",
type: "qapp",
sound: config.messageAlert,
url: "",
options: {
body: `You have an unread mail from ${mail.name}`,
icon: urlPic,
badge: urlPic
}
}
})
} else if (notificationsToShow.length > 0) {
if (notificationsToShow[0].created > (this.notifications[0]?.created || 0)) {
const mail = notificationsToShow[0]
const urlPic = `${nodeUrl}/arbitrary/THUMBNAIL/${mail.name}/qortal_avatar?async=true&apiKey=${this.getApiKey()}`
routes.showNotification({
data: { title: "New Q-Mail", type: "qapp", sound: config.messageAlert, url: "", options: { body: `You have an unread mail from ${mail.name}`, icon: urlPic, badge: urlPic } }
await routes.showNotification({
data: {
title: "New Q-Mail",
type: "qapp",
sound: config.messageAlert,
url: "",
options: {
body: `You have an unread mail from ${mail.name}`,
icon: urlPic,
badge: urlPic
}
}
})
}
}
this.notifications = notificationsToShow
if (this.notifications.length === 0) {
this.notificationCount = false
} else {
this.notificationCount = true
}
this.notificationCount = this.notifications.length !== 0;
if (!this.initialFetch) this.initialFetch = true
} catch (error) {

View File

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

View File

@ -1,7 +1,7 @@
import { LitElement, html, css } from 'lit'
import { connect } from 'pwa-helpers'
import { store } from '../../store.js'
import { get, translate } from '../../../translate/index.js'
import {css, html, LitElement} from 'lit'
import {connect} from 'pwa-helpers'
import {store} from '../../store.js'
import {get, translate} from '../../../translate'
class AccountView extends connect(store)(LitElement) {
static get properties() {
@ -127,8 +127,7 @@ class AccountView extends connect(store)(LitElement) {
getApiKey() {
const apiNode = store.getState().app.nodeConfig.knownNodes[store.getState().app.nodeConfig.node]
let apiKey = apiNode.apiKey
return apiKey
return apiNode.apiKey
}
stateChanged(state) {
@ -136,4 +135,4 @@ class AccountView extends connect(store)(LitElement) {
}
}
window.customElements.define('account-view', AccountView)
window.customElements.define('account-view', AccountView)

View File

@ -1,9 +1,9 @@
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 '../../../translate/index.js'
import {Epml} from '../../epml.js'
import {addTradeBotRoutes} from '../../tradebot/addTradeBotRoutes.js'
import {get, translate} from '../../../translate'
import snackbar from '../../functional-components/snackbar.js'
import FileSaver from 'file-saver'
@ -427,7 +427,7 @@ class ExportKeys extends connect(store)(LitElement) {
addTradeBotRoutes(parentEpml)
parentEpml.imReady()
await this.fetchArrrWalletAddress()
this.checkArrrWalletPrivateKey()
await this.checkArrrWalletPrivateKey()
}
async fetchArrrWalletAddress() {
@ -518,10 +518,10 @@ class ExportKeys extends connect(store)(LitElement) {
if (resRepair != null && resRepair.error != 128) {
this.shadowRoot.querySelector('#pleaseWaitDialog').close()
this.openOkDialog()
await this.openOkDialog()
} else {
this.shadowRoot.querySelector('#pleaseWaitDialog').close()
this.openErrorDialog()
await this.openErrorDialog()
}
}
@ -558,7 +558,7 @@ class ExportKeys extends connect(store)(LitElement) {
const myCoinAddress = cAddress
const blob = new Blob([`${myPrivateMasterKey}`], { type: 'text/plain;charset=utf-8' })
exportname = "Private_Master_Key_" + myCoinName + "_" + myCoinAddress + ".txt"
this.saveFileToDisk(blob, exportname)
await this.saveFileToDisk(blob, exportname)
}
async saveFileToDisk(blob, fileName) {
@ -590,8 +590,7 @@ class ExportKeys extends connect(store)(LitElement) {
getApiKey() {
const apiNode = store.getState().app.nodeConfig.knownNodes[store.getState().app.nodeConfig.node]
let apiKey = apiNode.apiKey
return apiKey
return apiNode.apiKey
}
}

View File

@ -1,20 +1,20 @@
import {css, html, LitElement} from 'lit'
import {connect} from 'pwa-helpers'
import {store} from '../../store.js'
import {allowShowSyncIndicator, removeShowSyncIndicator} from '../../redux/app/app-actions.js'
import {doSetQChatNotificationConfig} from '../../redux/user/user-actions.js'
import {translate} from '../../../translate/index.js'
import {translate} from '../../../translate'
import isElectron from 'is-electron'
import '@material/mwc-checkbox'
class NotificationsView extends connect(store)(LitElement) {
static get properties() {
return {
notificationConfig: { type: Object },
q_chatConfig: { type: Object },
theme: { type: String, reflect: true },
appNotificationList: {type: Array}
appNotificationList: { type: Array }
}
}
@ -26,8 +26,8 @@ class NotificationsView extends connect(store)(LitElement) {
this.appNotificationList = [] // Fetch the list of apps from local storage
}
firstUpdated(){
this.appNotificationList = this.getAppsFromStorage();
firstUpdated() {
this.appNotificationList = this.getAppsFromStorage()
}
static get styles() {
@ -54,6 +54,16 @@ class NotificationsView extends connect(store)(LitElement) {
}
}
.checkbox-row {
position: relative;
display: flex;
align-items: center;
align-content: center;
font-family: Montserrat, sans-serif;
font-weight: 600;
color: var(--black);
}
.content-box {
border: 1px solid #a1a1a1;
padding: 10px 25px;
@ -112,82 +122,91 @@ class NotificationsView extends connect(store)(LitElement) {
}
.remove-button {
font-family: Roboto, sans-serif;
font-size: 16px;
color: var(--mdc-theme-primary);
background-color: transparent;
padding: 8px 10px;
border-radius: 5px;
border: none;
transition: all 0.3s ease-in-out;
cursor: pointer;
}
font-family: Roboto, sans-serif;
font-size: 16px;
color: var(--mdc-theme-primary);
background-color: transparent;
padding: 8px 10px;
border-radius: 5px;
border: none;
transition: all 0.3s ease-in-out;
cursor: pointer;
}
`
}
render() {
return html`
<div class="sub-main">
<div class="notification-box">
<div class="content-box">
<h4> Q-Chat ${translate("settings.notifications")} </h4>
<div class="sub-main">
<div class="notification-box">
<div class="content-box">
<h4> Q-Chat ${translate("settings.notifications")} </h4>
<div style="line-height: 3rem;">
<mwc-checkbox id="qChatPlaySound" @click=${e => this.setQChatNotificationConfig({ type: 'PLAY_SOUND', value: e.target.checked })} ?checked=${this.q_chatConfig.playSound}></mwc-checkbox>
<label
<div style="line-height: 3rem;">
<mwc-checkbox id="qChatPlaySound" @click=${e => this.setQChatNotificationConfig({ type: 'PLAY_SOUND', value: e.target.checked })} ?checked=${this.q_chatConfig.playSound}></mwc-checkbox>
<label
for="qChatPlaySound"
@click=${() => this.shadowRoot.getElementById('qChatPlaySound').click()}
>${translate("settings.playsound")}</label>
</div>
>
${translate("settings.playsound")}
</label>
</div>
<div style="line-height: 3rem;">
<mwc-checkbox id="qChatShowNotification" @click=${e => this.setQChatNotificationConfig({ type: 'SHOW_NOTIFICATION', value: e.target.checked })} ?checked=${this.q_chatConfig.showNotification}></mwc-checkbox>
<label
<div style="line-height: 3rem;">
<mwc-checkbox id="qChatShowNotification" @click=${e => this.setQChatNotificationConfig({ type: 'SHOW_NOTIFICATION', value: e.target.checked })} ?checked=${this.q_chatConfig.showNotification}></mwc-checkbox>
<label
for="qChatShowNotification"
@click=${() => this.shadowRoot.getElementById('qChatShowNotification').click()}
>${translate("settings.shownotifications")}</label>
</div>
>
${translate("settings.shownotifications")}
</label>
</div>
<div class="content-box">
<h4>${translate("settings.qappNotification1")}</h4>
${this.appNotificationList.map((app)=> html`
<div style="display: flex; justify-content: space-between; margin-top: 10px;">
${app}
<button class="remove-button" @click=${() => this.removeApp(app)}>Remove</button>
</div>
`)}
</div>
</div>
${this.renderSetCoreButton()}
<div class="content-box">
<h4>${translate("settings.qappNotification1")}</h4>
${this.appNotificationList.map((app) => html`
<div style="display: flex; justify-content: space-between; margin-top: 10px;">
${app}
<button class="remove-button" @click=${() => this.removeApp(app)}>Remove</button>
</div>
`)}
</div>
</div>
<div class="checkbox-row">
<label for="syncIndicator" id="syncIndicatorLabel" style="color: var(--black);">
${translate("settings.sync_indicator")}
</label>
<mwc-checkbox style="margin-right: -15px;" id="syncIndicator" @click=${(e) => this.checkForSyncMessages(e)} ?checked=${store.getState().app.showSyncIndicator}></mwc-checkbox>
</div>
${this.renderSetCoreButton()}
</div>
`
}
getAppsFromStorage() {
// Your method to fetch the list of apps from local storage
// Example:
const address= store.getState().app.selectedAddress.address
const id = `appNotificationList-${address}`;
const data = localStorage.getItem(id);
return data ? Object.keys(JSON.parse(data)) : [];
}
const address = store.getState().app.selectedAddress.address
const id = `appNotificationList-${address}`
const data = localStorage.getItem(id)
return data ? Object.keys(JSON.parse(data)) : []
}
removeApp(appName) {
removeApp(appName) {
// Remove the app from local storage
this.removeAppFromStorage(appName);
// Update the apps list in the component
this.appNotificationList = this.appNotificationList.filter(app => app !== appName);
}
}
removeAppFromStorage(appName) {
removeAppFromStorage(appName) {
// Your method to remove the app from local storage
const address= store.getState().app.selectedAddress.address
const id = `appNotificationList-${address}`;
const data = JSON.parse(localStorage.getItem(id) || '{}');
delete data[appName];
localStorage.setItem(id, JSON.stringify(data));
}
}
renderSetCoreButton() {
if (!isElectron()) {
@ -205,6 +224,14 @@ class NotificationsView extends connect(store)(LitElement) {
window.electronAPI.setStartCore()
}
checkForSyncMessages(e) {
if (e.target.checked) {
store.dispatch(removeShowSyncIndicator(false))
} else {
store.dispatch(allowShowSyncIndicator(true))
}
}
stateChanged(state) {
this.notificationConfig = state.user.notifications
this.q_chatConfig = this.notificationConfig.q_chat
@ -226,8 +253,6 @@ class NotificationsView extends connect(store)(LitElement) {
store.dispatch(doSetQChatNotificationConfig(data))
}
}
}
window.customElements.define('notifications-view', NotificationsView)

View File

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

View File

@ -10,7 +10,7 @@ import {
removeQAPPAutoLists,
setIsOpenDevDialog
} from '../../redux/app/app-actions.js'
import {get, translate} from '../../../translate/index.js'
import {get, translate} from '../../../translate'
import snackbar from '../../functional-components/snackbar.js'
import FileSaver from 'file-saver'
@ -145,11 +145,11 @@ class SecurityView extends connect(store)(LitElement) {
</div>
</div>
<hr style="margin-top: 20px;">
<div class="checkbox-row">
<label for="authButton" id="authButtonLabel" style="color: var(--black);">
${get('browserpage.bchange26')}
</label>
<mwc-checkbox style="margin-right: -15px;" id="authButton" @click=${(e) => this.checkForAuth(e)} ?checked=${store.getState().app.qAPPAutoAuth}></mwc-checkbox>
<div class="checkbox-row">
<label for="authButton" id="authButtonLabel" style="color: var(--black);">
${get('browserpage.bchange26')}
</label>
<mwc-checkbox style="margin-right: -15px;" id="authButton" @click=${(e) => this.checkForAuth(e)} ?checked=${store.getState().app.qAPPAutoAuth}></mwc-checkbox>
</div>
<div class="checkbox-row">
<label for="authButton" id="authButtonLabel" style="color: var(--black);">
@ -158,19 +158,20 @@ 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">
<label for="authButton" id="authButtonLabel" style="color: var(--black);">
${get('browserpage.bchange53')}
</label>
<mwc-checkbox style="margin-right: -15px;" id="authButton" @click=${(e) => this.checkForFriends(e)} ?checked=${store.getState().app.qAPPFriendsList}></mwc-checkbox>
<label for="authButton" id="authButtonLabel" style="color: var(--black);">
${get('browserpage.bchange53')}
</label>
<mwc-checkbox style="margin-right: -15px;" id="authButton" @click=${(e) => this.checkForFriends(e)} ?checked=${store.getState().app.qAPPFriendsList}></mwc-checkbox>
</div>
<div class="checkbox-row">
<button
class="add-dev-button"
title="${translate('tabmenu.tm18')}"
@click=${this.openDevDialog}
>${translate('tabmenu.tm38')}</button>
<button
class="add-dev-button"
title="${translate('tabmenu.tm18')}"
@click=${this.openDevDialog}
>
${translate('tabmenu.tm38')}
</button>
</div>
</div>
`
}
@ -231,7 +232,7 @@ class SecurityView extends connect(store)(LitElement) {
const dataString = JSON.stringify(data)
const blob = new Blob([dataString], { type: 'text/plain;charset=utf-8' })
backupname = "qortal_backup_" + state.app.selectedAddress.address + ".json"
this.saveFileToDisk(blob, backupname)
await this.saveFileToDisk(blob, backupname)
}
async saveFileToDisk(blob, fileName) {

View File

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

View File

@ -8,7 +8,7 @@ import {repeat} from 'lit/directives/repeat.js';
import ShortUniqueId from 'short-unique-id';
import {setIsOpenDevDialog, setNewTab} from '../redux/app/app-actions.js'
import FileSaver from 'file-saver'
import {get, registerTranslateConfig, translate, use} from '../../translate/index.js'
import {get, registerTranslateConfig, translate, use} from '../../translate'
import '@material/mwc-button'
import '@material/mwc-dialog'
import '@material/mwc-icon'
@ -19,13 +19,12 @@ import '@polymer/paper-dialog/paper-dialog.js'
import '@vaadin/grid'
import '@vaadin/text-field'
import '../custom-elements/frag-file-input.js'
import { defaultQappsTabs } from '../data/defaultQapps.js'
import {defaultQappsTabs} from '../data/defaultQapps.js'
registerTranslateConfig({
loader: lang => fetch(`/language/${lang}.json`).then(res => res.json())
})
export const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
class ShowPlugin extends connect(store)(LitElement) {
@ -43,7 +42,7 @@ class ShowPlugin extends connect(store)(LitElement) {
chatLastSeen: { type: Array },
chatHeads: { type: Array },
proxyPort: { type: Number },
isOpenDevDialog: {type: Boolean}
isOpenDevDialog: { type: Boolean }
}
}
@ -211,7 +210,7 @@ class ShowPlugin extends connect(store)(LitElement) {
font-weight: bold;
background: none;
border: none;
color: var(--accent-color);
color: var(--general-color-blue);
font-size: 2em;
cursor: pointer;
transition: color 0.3s;
@ -229,7 +228,7 @@ class ShowPlugin extends connect(store)(LitElement) {
max-height: 28px;
padding: 5px 5px;
font-size: 14px;
background-color: var(--accent-color);
background-color: var(--general-color-blue);
color: white;
border: 1px solid transparent;
border-radius: 3px;
@ -248,7 +247,7 @@ class ShowPlugin extends connect(store)(LitElement) {
.iconActive {
position: absolute;
top: 5px;
color: var(--accent-color);
color: var(--general-color-blue);
--mdc-icon-size: 24px;
}
@ -260,7 +259,7 @@ class ShowPlugin extends connect(store)(LitElement) {
}
.tab:hover .iconInactive {
color: var(--accent-color);
color: var(--general-color-blue);
}
.count {
@ -843,7 +842,7 @@ class ShowPlugin extends connect(store)(LitElement) {
store.dispatch(setNewTab(null))
} else if (!this.tabs.find((tab) => tab.id === newTab.id)) {
this.addTab(newTab)
await this.addTab(newTab)
this.currentTab = this.tabs.length - 1
store.dispatch(setNewTab(null))
//clear newTab
@ -1078,7 +1077,7 @@ class NavBar extends connect(store)(LitElement) {
}
.resetIcon:hover {
color: var(--accent-color);
color: var(--general-color-blue);
font-weight: bold;
}
@ -1092,7 +1091,7 @@ class NavBar extends connect(store)(LitElement) {
}
.searchIcon:hover {
color: var(--accent-color);
color: var(--general-color-blue);
font-weight: bold;
}
@ -1106,7 +1105,7 @@ class NavBar extends connect(store)(LitElement) {
}
.importIcon:hover {
color: var(--accent-color);
color: var(--general-color-blue);
font-weight: bold;
}
@ -1120,7 +1119,7 @@ class NavBar extends connect(store)(LitElement) {
}
.exportIcon:hover {
color: var(--accent-color);
color: var(--general-color-blue);
font-weight: bold;
}
@ -1141,7 +1140,7 @@ class NavBar extends connect(store)(LitElement) {
paper-dialog button {
padding: 5px 10px;
font-size: 18px;
background-color: var(--accent-color);
background-color: var(--general-color-blue);
color: white;
border: 1px solid transparent;
border-radius: 5px;
@ -1175,7 +1174,7 @@ class NavBar extends connect(store)(LitElement) {
}
vaadin-text-field[focused]::part(input-field) {
border-color: var(--accent-color);
border-color: var(--general-color-blue);
}
`
@ -1474,8 +1473,7 @@ class NavBar extends connect(store)(LitElement) {
res()
}, 1000);
})
const detail = event.detail
this.myMenuPlugins = detail
this.myMenuPlugins = event.detail
const addressInfo = this.addressInfo
const isMinter = addressInfo?.error !== 124 && +addressInfo?.level > 0
const isSponsor = +addressInfo?.level >= 5
@ -1589,11 +1587,9 @@ class NavBar extends connect(store)(LitElement) {
}
async getMyFollowedNames() {
let myFollowedNames = await parentEpml.request('apiCall', {
url: `/lists/followedNames?apiKey=${this.getApiKey()}`
})
this.myFollowedNames = myFollowedNames
this.myFollowedNames = await parentEpml.request('apiCall', {
url: `/lists/followedNames?apiKey=${this.getApiKey()}`
})
}
searchNameKeyListener(e) {
@ -1693,7 +1689,7 @@ class NavBar extends connect(store)(LitElement) {
let err3string = get("appspage.schange22")
parentEpml.request('showSnackBar', `${err3string}`)
}
this.getMyFollowedNamesList()
await this.getMyFollowedNamesList()
return ret
}
@ -1719,7 +1715,7 @@ class NavBar extends connect(store)(LitElement) {
let err4string = get("appspage.schange23")
parentEpml.request('showSnackBar', `${err4string}`)
}
this.getMyFollowedNamesList()
await this.getMyFollowedNamesList()
return ret
}
@ -1996,11 +1992,7 @@ class NavBar extends connect(store)(LitElement) {
this.myPluginNameRes = res
})
if (this.myPluginNameRes === undefined || this.myPluginNameRes.length == 0) {
myPluginName = false
} else {
myPluginName = true
}
myPluginName = !(this.myPluginNameRes === undefined || this.myPluginNameRes.length == 0);
return myPluginName
}
@ -2061,11 +2053,7 @@ class NavBar extends connect(store)(LitElement) {
this.myPluginNameRes = res
})
if (this.myPluginNameRes === undefined || this.myPluginNameRes.length == 0 ) {
myPluginName = false
} else {
myPluginName = true
}
myPluginName = !(this.myPluginNameRes === undefined || this.myPluginNameRes.length == 0);
return myPluginName
}
@ -2407,7 +2395,7 @@ class NavBar extends connect(store)(LitElement) {
async handlePasteLink(e) {
try {
const value = this.shadowRoot.getElementById('linkInput').value
this.getQuery(value)
await this.getQuery(value)
} catch (error) {
}
}
@ -2416,7 +2404,7 @@ class NavBar extends connect(store)(LitElement) {
if (e.key === 'Enter') {
try {
const value = this.shadowRoot.getElementById('linkInput').value
this.getQuery(value)
await this.getQuery(value)
} catch (error) {
}
}
@ -2424,8 +2412,7 @@ class NavBar extends connect(store)(LitElement) {
getApiKey() {
const apiNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
let apiKey = apiNode.apiKey
return apiKey
return apiNode.apiKey
}
isEmptyArray(arr) {

View File

@ -1,7 +1,7 @@
import {css, html, LitElement} from 'lit';
import {connect} from 'pwa-helpers';
import {store} from '../store.js';
import {get, translate} from '../../translate/index.js'
import {get, translate} from '../../translate'
import {asyncReplace} from 'lit/directives/async-replace.js';
import '../functional-components/my-button.js';
@ -235,9 +235,7 @@ const nonce = selectedAddress && selectedAddress.nonce;
const url = `${nodeUrl}/admin/mintingaccounts`;
try {
const res = await fetch(url);
const mintingAccountData = await res.json();
this.mintingAccountData = mintingAccountData;
this.mintingAccountData = await res.json();
} catch (error) {
this.errorMsg = this.renderErrorMsg1();
}
@ -286,14 +284,14 @@ const nonce = selectedAddress && selectedAddress.nonce;
try {
await addMintingAccount(this.privateRewardShareKey);
routes.showSnackBar({
await routes.showSnackBar({
data: translate('becomeMinterPage.bchange19'),
});
this.status = 5;
this.getMintingAcccounts();
await this.getMintingAcccounts();
} catch (error) {
this.errorMsg = this.renderErrorMsg3();
return;
}
}
@ -311,8 +309,7 @@ const nonce = selectedAddress && selectedAddress.nonce;
const rewardShares = async (minterAddr) => {
const url = `${nodeUrl}/addresses/rewardshares?minters=${minterAddr}&recipients=${minterAddr}`;
const res = await fetch(url);
const data = await res.json();
return data;
return await res.json();
};
if (!stop) {
@ -352,7 +349,7 @@ const nonce = selectedAddress && selectedAddress.nonce;
let rewarddialog3 = get('transactions.rewarddialog3');
let rewarddialog4 = get('transactions.rewarddialog4');
let myTxnrequest = await routes.transaction({
return await routes.transaction({
data: {
type: 38,
nonce: nonce,
@ -368,7 +365,6 @@ const nonce = selectedAddress && selectedAddress.nonce;
},
disableModal: true,
});
return myTxnrequest;
};
const getTxnRequestResponse = (txnResponse) => {
@ -404,8 +400,7 @@ const nonce = selectedAddress && selectedAddress.nonce;
const getLastRef = async () => {
const url = `${nodeUrl}/addresses/lastreference/${address}`;
const res = await fetch(url);
const data = await res.text();
return data;
return await res.text();
};
const startMinting = async () => {
@ -422,11 +417,11 @@ const nonce = selectedAddress && selectedAddress.nonce;
try {
this.privateRewardShareKey = await createSponsorshipKey();
this.confirmRelationship(publicAddress)
await this.confirmRelationship(publicAddress)
} catch (error) {
console.log({ error })
this.errorMsg = (error && error.data && error.data.message) ? error.data.message : this.renderErrorMsg4();
return;
}
};
@ -438,7 +433,7 @@ const nonce = selectedAddress && selectedAddress.nonce;
.onClick=${async () => {
await startMinting();
if (this.errorMsg) {
routes.showSnackBar({
await routes.showSnackBar({
data: this.errorMsg,
});
}

View File

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

View File

@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit'
import {render} from 'lit/html.js'
import {connect} from 'pwa-helpers'
import {store} from '../../store.js'
import {get, translate} from '../../../translate/index.js'
import {get, translate} from '../../../translate'
import '@polymer/paper-dialog/paper-dialog.js'
import '@material/mwc-button'
@ -1374,13 +1374,11 @@ class UserInfoView extends connect(store)(LitElement) {
const nodeUrl = myNode.protocol + '://' + myNode.domain + ':' + myNode.port
const fromNameUrl = `${nodeUrl}/names/${fromName}`
const qortalNameInfo = await fetch(fromNameUrl).then(response => {
return response.json()
})
this.nameAddressResult = qortalNameInfo
this.nameAddressResult = await fetch(fromNameUrl).then(response => {
return response.json()
})
const nameAddress = this.nameAddressResult.owner
this.getAllWithAddress(nameAddress)
await this.getAllWithAddress(nameAddress)
}
async getAllWithAddress(myAddress) {
@ -1401,11 +1399,9 @@ class UserInfoView extends connect(store)(LitElement) {
const nodeUrl = myNode.protocol + '://' + myNode.domain + ':' + myNode.port
const infoAddressUrl = `${nodeUrl}/addresses/${infoAddress}`
const qortalAddressInfo = await fetch(infoAddressUrl).then(response => {
return response.json()
})
this.addressResult = qortalAddressInfo
this.addressResult = await fetch(infoAddressUrl).then(response => {
return response.json()
})
}
async getAddressUserAvatar(avatarAddress) {
@ -1427,8 +1423,7 @@ class UserInfoView extends connect(store)(LitElement) {
}
})
const myImageUrl = `${nodeUrl}/arbitrary/THUMBNAIL/${this.imageName}/qortal_avatar?async=true&apiKey=${this.getApiKey()}`
this.imageUrl = myImageUrl
this.imageUrl = `${nodeUrl}/arbitrary/THUMBNAIL/${this.imageName}/qortal_avatar?async=true&apiKey=${this.getApiKey()}`
}
async getAddressUserBalance(balanceAddress) {
@ -1451,19 +1446,15 @@ class UserInfoView extends connect(store)(LitElement) {
const nodeUrl = myNode.protocol + '://' + myNode.domain + ':' + myNode.port
if (checkBlocks === 0) {
let noMinterString = get("explorerpage.exp16")
this.startMintTime = noMinterString
this.startMintTime = get("explorerpage.exp16")
} else {
const rewardshareUrl = `${nodeUrl}/transactions/search?txType=REWARD_SHARE&address=${mintAddress}&confirmationStatus=CONFIRMED&limit=1&reverse=false`
const startMinting = await fetch(rewardshareUrl).then(response => {
return response.json()
})
this.startMinting = await fetch(rewardshareUrl).then(response => {
return response.json()
})
this.startMinting = startMinting
const mintString = new Date(this.startMinting[0].timestamp).toLocaleDateString()
this.startMintTime = mintString
this.startMintTime = new Date(this.startMinting[0].timestamp).toLocaleDateString()
}
}
@ -1928,9 +1919,8 @@ class UserInfoView extends connect(store)(LitElement) {
}
getApiKey() {
const apiNode = store.getState().app.nodeConfig.knownNodes[store.getState().app.nodeConfig.node];
let apiKey = apiNode.apiKey;
return apiKey;
const apiNode = store.getState().app.nodeConfig.knownNodes[store.getState().app.nodeConfig.node]
return apiNode.apiKey
}
isEmptyArray(arr) {
@ -1941,8 +1931,7 @@ class UserInfoView extends connect(store)(LitElement) {
}
round(number) {
let result = (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
return result
return (Math.round(parseFloat(number) * 1e8) / 1e8).toFixed(8)
}
}

View File

@ -1,10 +1,7 @@
import {css, html, LitElement} from 'lit'
import {connect} from 'pwa-helpers'
import {store} from '../store.js'
import {translate} from '../../translate/index.js'
import '@polymer/paper-toast'
import '@material/mwc-icon-button'
import {translate} from '../../translate'
class WalletProfile extends connect(store)(LitElement) {
static get properties() {
@ -12,82 +9,76 @@ class WalletProfile extends connect(store)(LitElement) {
wallet: { type: Object },
nodeConfig: { type: Object },
accountInfo: { type: Object },
imageUrl: { type: String },
theme: { type: String, reflect: true }
}
}
static get styles() {
return [
css`
`
]
return css`
#profileInMenu {
padding: 12px;
border-top: var(--border);
background: var(--sidetopbar);
color: var(--black);
}
#accountName {
margin: 0;
font-size: 18px;
font-weight: 500;
width: 100%;
padding-bottom: 8px;
display: flex;
}
#blocksMinted {
margin:0;
margin-top: 0;
font-size: 12px;
color: #03a9f4;
}
#address {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin:0;
margin-top: 8px;
font-size: 11px;
}
.round-fullinfo {
position: relative;
width: 68px;
height: 68px;
border-radius: 50%;
}
.full-info-logo {
width: 68px;
height: 68px;
border-radius: 50%;
}
.inline-block-child {
flex: 1;
}
`
}
constructor() {
super()
this.wallet = {}
this.nodeConfig = {}
this.accountInfo = {
names: [],
addressInfo: {}
}
this.imageUrl = ''
this.theme = localStorage.getItem('qortalTheme') ? localStorage.getItem('qortalTheme') : 'light'
}
render() {
return html`
<style>
#profileInMenu {
padding: 12px;
border-top: var(--border);
background: var(--sidetopbar);
color: var(--black);
}
#profileInMenu:hover {
}
#accountIcon {
font-size:48px;
color: var(--mdc-theme-primary);
display: inline-block;
}
#accountName {
margin: 0;
font-size: 18px;
font-weight:500;
width:100%;
padding-bottom:8px;
display: flex;
}
#blocksMinted {
margin:0;
margin-top: 0;
font-size: 12px;
color: #03a9f4;
}
#address {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin:0;
margin-top:8px;
font-size:11px;
}
.round-fullinfo {
position: relative;
width: 68px;
height: 68px;
border-radius: 50%;
}
.full-info-logo {
width: 68px;
height: 68px;
border-radius: 50%;
}
.inline-block-child {
flex: 1;
}
</style>
<div id="profileInMenu">
<div style="padding: 8px 0;">
<div id="accountName">
@ -102,26 +93,10 @@ class WalletProfile extends connect(store)(LitElement) {
<p id="address">${this.wallet.addresses[0].address}</p>
</div>
</div>
<paper-toast id="toast" horizontal-align="right" vertical-align="top" vertical-offset="64"></paper-toast>
`
}
firstUpdated() {
const container = document.body.querySelector('main-app').shadowRoot.querySelector('app-view').shadowRoot;
const toast = this.shadowRoot.getElementById('toast')
const isMobile = window.matchMedia(`(max-width: ${getComputedStyle(document.body).getPropertyValue('--layout-breakpoint-tablet')})`).matches
if (isMobile) {
toast.verticalAlign = 'bottom'
toast.verticalOffset = 0
}
this.toast = container.appendChild(toast)
}
async getAllWithAddress(myAddress) {
await this.getAddressUserAvatar(myAddress)
}
firstUpdated() {}
getAvatar() {
if (this.accountInfo.names.length === 0) {
@ -135,9 +110,8 @@ class WalletProfile extends connect(store)(LitElement) {
}
getApiKey() {
const apiNode = store.getState().app.nodeConfig.knownNodes[store.getState().app.nodeConfig.node];
let apiKey = apiNode.apiKey;
return apiKey;
const apiNode = store.getState().app.nodeConfig.knownNodes[store.getState().app.nodeConfig.node]
return apiNode.apiKey
}
stateChanged(state) {

View File

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

View File

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

View File

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

View File

@ -2,7 +2,7 @@ import {css, html, LitElement} from 'lit'
import {connect} from 'pwa-helpers'
import {store} from '../store.js'
import {doAddNode, doEditNode, doLoadNodeConfig, doRemoveNode, doSetNode} from '../redux/app/app-actions.js'
import {get, registerTranslateConfig, translate, use} from '../../translate/index.js'
import {get, registerTranslateConfig, translate, use} from '../../translate'
import snackbar from './snackbar.js'
import '../components/language-selector.js'
import '../custom-elements/frag-file-input.js'
@ -70,7 +70,7 @@ class SettingsPage extends connect(store)(LitElement) {
display: inline-block;
width: 150px;
font-weight: 600;
color: var(--accent-color);
color: var(--general-color-blue);
border: 1px solid transparent;
}
@ -87,7 +87,7 @@ class SettingsPage extends connect(store)(LitElement) {
}
.buttonBlue {
color: var(--accent-color);
color: var(--general-color-blue);
}
.floatleft {
@ -211,8 +211,7 @@ class SettingsPage extends connect(store)(LitElement) {
// Set the selected value for mwc-select
const protocolList = dialog.querySelector('#protocolList')
const desiredProtocol = currentValues.protocol
protocolList.value = desiredProtocol
protocolList.value = currentValues.protocol
this.isBeingEdited = true
this.isBeingEditedIndex = index
this.shadowRoot.querySelector('#addNodeDialog').show()

View File

@ -171,9 +171,7 @@ export const newMessageNotificationQappLocal = (data) => {
}
notify.onclick = async(e) => {
const url = data?.url
const value = url
let newQuery = value;
let newQuery = data?.url;
if (newQuery.endsWith('/')) {
newQuery = newQuery.slice(0, -1);
}
@ -217,9 +215,7 @@ export const newMessageNotificationQappLocal = (data) => {
const notify = new Notification(data.title, data.options)
notify.onclick = async(e) => {
const url = data?.url
const value = url
let newQuery = value;
let newQuery = data?.url;
if (newQuery.endsWith('/')) {
newQuery = newQuery.slice(0, -1);
}

View File

@ -198,11 +198,8 @@ export const routes = {
username: async (req) => {
const state = store.getState()
const username =
state.user.storedWallets[state.app.wallet.addresses[0].address]
.name
return username
return state.user.storedWallets[state.app.wallet.addresses[0].address]
.name
},
chat: async (req) => {
@ -343,9 +340,7 @@ export const routes = {
tradeBotRespondRequest: async (req) => {
let response
try {
const res = await tradeBotRespondRequest(req.data)
response = res
response = await tradeBotRespondRequest(req.data)
} catch (e) {
console.error(e)
console.error(e.message)
@ -385,10 +380,9 @@ export const routes = {
cancelAllOffers: async (req) => {
let response
try {
const res = await cancelAllOffers(
response = await cancelAllOffers(
store.getState().app.selectedAddress
)
response = res
} catch (e) {
console.error(e)
console.error(e.message)
@ -400,8 +394,7 @@ export const routes = {
sendBtc: async (req) => {
let response
try {
const res = await sendBtc(req.data)
response = res
response = await sendBtc(req.data)
} catch (e) {
console.error(e)
console.error(e.message)
@ -413,8 +406,7 @@ export const routes = {
sendLtc: async (req) => {
let response
try {
const res = await sendLtc(req.data)
response = res
response = await sendLtc(req.data)
} catch (e) {
console.error(e)
console.error(e.message)
@ -426,8 +418,7 @@ export const routes = {
sendDoge: async (req) => {
let response
try {
const res = await sendDoge(req.data)
response = res
response = await sendDoge(req.data)
} catch (e) {
console.error(e)
console.error(e.message)
@ -439,8 +430,7 @@ export const routes = {
sendDgb: async (req) => {
let response
try {
const res = await sendDgb(req.data)
response = res
response = await sendDgb(req.data)
} catch (e) {
console.error(e)
console.error(e.message)
@ -452,8 +442,7 @@ export const routes = {
sendRvn: async (req) => {
let response
try {
const res = await sendRvn(req.data)
response = res
response = await sendRvn(req.data)
} catch (e) {
console.error(e)
console.error(e.message)
@ -465,8 +454,7 @@ export const routes = {
sendArrr: async (req) => {
let response
try {
const res = await sendArrr(req.data)
response = res
response = await sendArrr(req.data)
} catch (e) {
console.error(e)
console.error(e.message)

View File

@ -20,9 +20,11 @@ import {
UPDATE_BLOCK_INFO,
UPDATE_NODE_INFO,
UPDATE_NODE_STATUS,
SET_PROFILE_DATA,
ALLOW_QAPP_FRIENDS_LIST,
REMOVE_QAPP_FRIENDS_LIST
SET_PROFILE_DATA,
ALLOW_QAPP_FRIENDS_LIST,
REMOVE_QAPP_FRIENDS_LIST,
ALLOW_SHOW_SYNC_INDICATOR,
REMOVE_SHOW_SYNC_INDICATOR
} from '../app-action-types.js'
export const doUpdateBlockInfo = (blockObj) => {
@ -164,18 +166,21 @@ export const setNewTab = (payload) => {
payload
}
}
export const setNewNotification = (payload) => {
return {
type: SET_NEW_NOTIFICATION,
payload
}
}
export const setIsOpenDevDialog = (payload)=> {
export const setIsOpenDevDialog = (payload) => {
return {
type: IS_OPEN_DEV_DIALOG,
payload
}
}
export const addTabInfo = (payload) => {
return {
type: ADD_TAB_INFO,
@ -196,16 +201,31 @@ export const setSideEffectAction = (payload)=> {
payload
}
}
export const setProfileData = (payload)=> {
export const setProfileData = (payload) => {
return {
type: SET_PROFILE_DATA,
payload
}
}
export const setCoinBalances = (payload)=> {
export const setCoinBalances = (payload) => {
return {
type: SET_COIN_BALANCES,
payload
}
}
export const allowShowSyncIndicator = (payload) => {
return {
type: ALLOW_SHOW_SYNC_INDICATOR,
payload
}
}
export const removeShowSyncIndicator = (payload) => {
return {
type: REMOVE_SHOW_SYNC_INDICATOR,
payload
}
}

View File

@ -34,6 +34,8 @@ export const IS_OPEN_DEV_DIALOG = 'IS_OPEN_DEV_DIALOG'
export const SET_NEW_NOTIFICATION = 'SET_NEW_NOTIFICATION'
export const SET_SIDE_EFFECT= 'SET_SIDE_EFFECT'
export const SET_PROFILE_DATA = 'SET_PROFILE_DATA'
export const SET_COIN_BALANCES= 'SET_COIN_BALANCES'
export const ALLOW_QAPP_FRIENDS_LIST= 'ALLOW_QAPP_FRIENDS_LIST'
export const REMOVE_QAPP_FRIENDS_LIST= 'REMOVE_QAPP_FRIENDS_LIST'
export const SET_COIN_BALANCES = 'SET_COIN_BALANCES'
export const ALLOW_QAPP_FRIENDS_LIST = 'ALLOW_QAPP_FRIENDS_LIST'
export const REMOVE_QAPP_FRIENDS_LIST = 'REMOVE_QAPP_FRIENDS_LIST'
export const ALLOW_SHOW_SYNC_INDICATOR = 'ALLOW_SHOW_SYNC_INDICATOR'
export const REMOVE_SHOW_SYNC_INDICATOR = 'REMOVE_SHOW_SYNC_INDICATOR'

View File

@ -36,9 +36,11 @@ import {
UPDATE_BLOCK_INFO,
UPDATE_NODE_INFO,
UPDATE_NODE_STATUS,
SET_PROFILE_DATA,
ALLOW_QAPP_FRIENDS_LIST,
REMOVE_QAPP_FRIENDS_LIST
SET_PROFILE_DATA,
ALLOW_QAPP_FRIENDS_LIST,
REMOVE_QAPP_FRIENDS_LIST,
ALLOW_SHOW_SYNC_INDICATOR,
REMOVE_SHOW_SYNC_INDICATOR
} from './app-action-types.js'
import {initWorkersReducer} from './reducers/init-workers.js'
import {loginReducer} from './reducers/login-reducer.js'
@ -49,8 +51,6 @@ const chatLastSeen = localForage.createInstance({
name: "chat-last-seen",
});
const INITIAL_STATE = {
loggedIn: false,
drawerOpen: false,
@ -88,6 +88,7 @@ const INITIAL_STATE = {
qAPPAutoAuth: loadStateFromLocalStorage('qAPPAutoAuth') || false,
qAPPAutoLists: loadStateFromLocalStorage('qAPPAutoLists') || false,
qAPPFriendsList: loadStateFromLocalStorage('qAPPFriendsList') || false,
showSyncIndicator: loadStateFromLocalStorage('showSyncIndicator') || false,
chatLastSeen: [],
newTab: null,
tabInfo: {},
@ -228,6 +229,7 @@ export default (state = INITIAL_STATE, action) => {
qAPPAutoAuth: action.payload
}
}
case ALLOW_QAPP_AUTO_LISTS: {
saveStateToLocalStorage("qAPPAutoLists", true)
return {
@ -266,6 +268,7 @@ export default (state = INITIAL_STATE, action) => {
chatLastSeen: action.payload
}
}
case ADD_CHAT_LAST_SEEN: {
const chatId = action.payload.key
const timestamp = action.payload.timestamp
@ -299,12 +302,14 @@ export default (state = INITIAL_STATE, action) => {
newTab: action.payload
}
}
case IS_OPEN_DEV_DIALOG: {
return {
...state,
isOpenDevDialog: action.payload
}
}
case ADD_TAB_INFO: {
const newTabInfo = action.payload
if (state.tabInfo[newTabInfo.id] && state.tabInfo[newTabInfo.id].name && newTabInfo.name === state.tabInfo[newTabInfo.id].name) break
@ -319,6 +324,7 @@ export default (state = INITIAL_STATE, action) => {
}
}
}
case SET_TAB_NOTIFICATIONS: {
const count = action.payload.count
const name = action.payload.name
@ -346,18 +352,21 @@ export default (state = INITIAL_STATE, action) => {
newNotification: action.payload
}
}
case SET_SIDE_EFFECT: {
return {
...state,
sideEffectAction: action.payload
}
}
case SET_PROFILE_DATA: {
return {
...state,
profileData: action.payload
}
}
case SET_COIN_BALANCES: {
const copyBalances = {...state.coinBalances}
copyBalances[action.payload.type] = {
@ -370,6 +379,22 @@ export default (state = INITIAL_STATE, action) => {
}
}
case ALLOW_SHOW_SYNC_INDICATOR: {
saveStateToLocalStorage("showSyncIndicator", true)
return {
...state,
showSyncIndicator: action.payload
}
}
case REMOVE_SHOW_SYNC_INDICATOR: {
saveStateToLocalStorage("showSyncIndicator", false)
return {
...state,
showSyncIndicator: action.payload
}
}
default:
return state
}

View File

@ -114,8 +114,7 @@ export const routes = {
store.getState().app.selectedAddress.keyPair
)
const res = await processTransaction(signedTxnBytes)
response = res
response = await processTransaction(signedTxnBytes)
} catch (e) {
console.error(e)
console.error(e.message)
@ -127,8 +126,7 @@ export const routes = {
tradeBotRespondRequest: async (req) => {
let response
try {
const res = await tradeBotRespondRequest(req.data)
response = res
response = await tradeBotRespondRequest(req.data)
} catch (e) {
console.error(e)
console.error(e.message)
@ -147,9 +145,7 @@ export const routes = {
store.getState().app.selectedAddress.keyPair
)
const res = await processTransaction(signedTxnBytes)
response = res
response = await processTransaction(signedTxnBytes)
} catch (e) {
console.error(e)
console.error(e.message)
@ -161,10 +157,9 @@ export const routes = {
cancelAllOffers: async (req) => {
let response
try {
const res = await cancelAllOffers(
response = await cancelAllOffers(
store.getState().app.selectedAddress
)
response = res
} catch (e) {
console.error(e)
console.error(e.message)
@ -176,8 +171,7 @@ export const routes = {
sendBtc: async (req) => {
let response
try {
const res = await sendBtc(req.data)
response = res
response = await sendBtc(req.data)
} catch (e) {
console.error(e)
console.error(e.message)
@ -189,8 +183,7 @@ export const routes = {
sendLtc: async (req) => {
let response
try {
const res = await sendLtc(req.data)
response = res
response = await sendLtc(req.data)
} catch (e) {
console.error(e)
console.error(e.message)
@ -202,8 +195,7 @@ export const routes = {
sendDoge: async (req) => {
let response
try {
const res = await sendDoge(req.data)
response = res
response = await sendDoge(req.data)
} catch (e) {
console.error(e)
console.error(e.message)
@ -215,8 +207,7 @@ export const routes = {
sendDgb: async (req) => {
let response
try {
const res = await sendDgb(req.data)
response = res
response = await sendDgb(req.data)
} catch (e) {
console.error(e)
console.error(e.message)
@ -228,8 +219,7 @@ export const routes = {
sendRvn: async (req) => {
let response
try {
const res = await sendRvn(req.data)
response = res
response = await sendRvn(req.data)
} catch (e) {
console.error(e)
console.error(e.message)
@ -241,8 +231,7 @@ export const routes = {
sendArrr: async (req) => {
let response
try {
const res = await sendArrr(req.data)
response = res
response = await sendArrr(req.data)
} catch (e) {
console.error(e)
console.error(e.message)

View File

@ -17,20 +17,15 @@ const uiCoreController = (type) => {
const { createServer } = require('./server/server.js')
return createServer
case BUILD:
const build = require('./tooling/build.js')
return build
return require('./tooling/build.js')
case WATCH:
const watch = require('./tooling/watch.js')
return watch
return require('./tooling/watch.js')
case WATCH_INLINE:
const watchInlines = require('./tooling/watch-inlines.js')
return watchInlines
return require('./tooling/watch-inlines.js')
case DEFAULT_CONFIG:
const defaultConfig = require('./config/config.js')
return defaultConfig
return require('./config/config.js')
case GENERATE_BUILD_CONFIG:
const generateBuildConfig = require('./tooling/generateBuildConfig.js')
return generateBuildConfig
return require('./tooling/generateBuildConfig.js')
default:
return
}

View File

@ -309,8 +309,7 @@ export default class AltcoinHDWallet {
// PublicKey Hash
const publicKeySHA256 = new Sha256().process(new Uint8Array(this.publicKey)).finish().result
const _publicKeyHash = new RIPEMD160().update(Buffer.from(publicKeySHA256)).digest('hex')
this.publicKeyHash = _publicKeyHash
this.publicKeyHash = new RIPEMD160().update(Buffer.from(publicKeySHA256)).digest('hex')
}
generateMainnetMasterPrivateKey() {
@ -505,8 +504,7 @@ export default class AltcoinHDWallet {
// PublicKey Hash
const childPublicKeySHA256 = new Sha256().process(new Uint8Array(this.childPublicKey)).finish().result
const _childPublicKeyHash = new RIPEMD160().update(Buffer.from(childPublicKeySHA256)).digest('hex')
this.childPublicKeyHash = _childPublicKeyHash
this.childPublicKeyHash = new RIPEMD160().update(Buffer.from(childPublicKeySHA256)).digest('hex')
// Call deriveExtendedPublicChildKey // WIll be hardcoding the values...
@ -658,8 +656,7 @@ export default class AltcoinHDWallet {
// PublicKey Hash
const grandChildPublicKeySHA256 = new Sha256().process(new Uint8Array(this.grandChildPublicKey)).finish().result
const _grandChildPublicKeyHash = new RIPEMD160().update(Buffer.from(grandChildPublicKeySHA256)).digest('hex')
this.grandChildPublicKeyHash = _grandChildPublicKeyHash
this.grandChildPublicKeyHash = new RIPEMD160().update(Buffer.from(grandChildPublicKeySHA256)).digest('hex')
// Call deriveExtendedPublicChildKey // WIll be hardcoding the values...

View File

@ -24,6 +24,5 @@ export const createWallet = async (sourceType, source, statusUpdateFn) => {
throw 'sourceType ' + sourceType + ' not recognized'
}
const wallet = new PhraseWallet(seed, version)
return wallet
return new PhraseWallet(seed, version)
}

View File

@ -1,7 +1,7 @@
import Base58 from './deps/Base58.js'
import {kdf} from './kdf.js'
import {AES_CBC, HmacSha512} from 'asmcrypto.js'
import {get, registerTranslateConfig} from '../../core/translate/index.js'
import {get, registerTranslateConfig} from '../../core/translate'
registerTranslateConfig({
loader: lang => fetch(`/language/${lang}.json`).then(res => res.json())
@ -27,6 +27,5 @@ export const decryptStoredWallet = async (password, wallet, statusFn = () => { }
}
const sfn5 = get("login.lp16")
statusFn(sfn5)
const decryptedBytes = AES_CBC.decrypt(encryptedSeedBytes, encryptionKey, false, iv)
return decryptedBytes
return AES_CBC.decrypt(encryptedSeedBytes, encryptionKey, false, iv)
}

View File

@ -14,11 +14,10 @@ Base64.decode = function (string) {
}
const decoder = new TextDecoder();
const decodedString = decoder.decode(bytes);
return decodedString;
return decoder.decode(bytes);
};
export default Base64;
export default Base64;

View File

@ -593,7 +593,7 @@
}
dst(c1);
}
if (c2 !== null) dst(c2);
if (false) dst(c2);
};
/**

View File

@ -2378,7 +2378,7 @@ nacl.verify = function(x, y) {
// Zero length arguments are considered not equal.
if (x.length === 0 || y.length === 0) return false;
if (x.length !== y.length) return false;
return (vn(x, 0, y, 0, x.length) === 0) ? true : false;
return (vn(x, 0, y, 0, x.length) === 0);
};
nacl.setPRNG = function(fn) {
@ -2419,4 +2419,4 @@ nacl.setPRNG = function(fn) {
// == CHANGE TO ES6 EXPORT == //
//})(typeof module !== 'undefined' && module.exports ? module.exports : (window.nacl = window.nacl || {}));
export default nacl
export default nacl

View File

@ -21,8 +21,7 @@ export async function request(url, options) {
body,
}).then(async (response) => {
try {
const json = await response.clone().json()
return json
return await response.clone().json()
} catch (e) {
return await response.text()
}

View File

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

View File

@ -30,9 +30,7 @@ const signArbitrary = (arbitraryBytesBase58, arbitraryBytesForSigningBase58, non
const signature = nacl.sign.detached(arbitraryBytesForSigningBuffer, keyPair.privateKey)
const signedBytes = utils.appendBuffer(arbitraryBytesBuffer, signature)
return signedBytes
return utils.appendBuffer(arbitraryBytesBuffer, signature)
}
export default signArbitrary

View File

@ -21,13 +21,11 @@ const signArbitraryWithFee = (arbitraryBytesBase58, arbitraryBytesForSigningBase
const _arbitraryBytesForSigningBuffer = Object.keys(arbitraryBytesForSigning).map(function (key) { return arbitraryBytesForSigning[key]; })
const arbitraryBytesForSigningBuffer = new Uint8Array(_arbitraryBytesForSigningBuffer)
const signature = nacl.sign.detached(arbitraryBytesForSigningBuffer, keyPair.privateKey)
const signedBytes = utils.appendBuffer(arbitraryBytesBuffer, signature)
return signedBytes
return utils.appendBuffer(arbitraryBytesBuffer, signature)
}
export default signArbitraryWithFee

View File

@ -25,18 +25,14 @@ const signChat = (chatBytes, nonce, keyPair) => {
const signature = nacl.sign.detached(chatBytesBuffer, keyPair.privateKey)
const signedBytes = utils.appendBuffer(chatBytesBuffer, signature)
return signedBytes
return utils.appendBuffer(chatBytesBuffer, signature)
} else {
const chatBytesBuffer = new Uint8Array(chatBytes)
chatBytesBuffer.set(_nonce, 112)
const signature = nacl.sign.detached(chatBytesBuffer, keyPair.privateKey)
const signedBytes = utils.appendBuffer(chatBytesBuffer, signature)
return signedBytes
return utils.appendBuffer(chatBytesBuffer, signature)
}
}

View File

@ -17,14 +17,10 @@ const signTradeBotTransaction = (unsignedTxn, keyPair) => {
const _privateKey = Object.keys(keyPair.privateKey).map(function (key) { return keyPair.privateKey[key]; })
const privateKey = new Uint8Array(_privateKey)
const signature = nacl.sign.detached(txnBuffer, privateKey)
const signedBytes = utils.appendBuffer(txnBuffer, signature)
return signedBytes
return utils.appendBuffer(txnBuffer, signature)
} else {
const signature = nacl.sign.detached(txnBuffer, keyPair.privateKey)
const signedBytes = utils.appendBuffer(txnBuffer, signature)
return signedBytes
return utils.appendBuffer(txnBuffer, signature)
}
}

View File

@ -9,8 +9,7 @@ export const cancelAllOffers = async (requestObject) => {
const getMyOpenOffers = async () => {
const res = await request('/crosschain/tradeoffers')
const myOpenTradeOrders = await res.filter(order => order.mode === "OFFERING" && order.qortalCreator === address)
return myOpenTradeOrders
return await res.filter(order => order.mode === "OFFERING" && order.qortalCreator === address)
}
const myOpenOffers = await getMyOpenOffers()

View File

@ -3,6 +3,5 @@ import Base58 from '../deps/Base58.js'
export const base58PublicKeyToAddress = (base58pubkey, qora = false) => {
const decodePubKey = Base58.decode(base58pubkey)
const address = publicKeyToAddress(decodePubKey, qora)
return address
return publicKeyToAddress(decodePubKey, qora)
}

View File

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

View File

@ -2,16 +2,12 @@ const {
app,
BrowserWindow,
ipcMain,
ipcRenderer,
Menu,
Notification,
Tray,
nativeImage,
dialog,
webContents,
nativeTheme,
crashReporter,
webFrame
crashReporter
} = require('electron')
const { autoUpdater } = require('electron-updater')
@ -42,16 +38,16 @@ crashReporter.start({
})
if (myMemory > 16000000000) {
app.commandLine.appendSwitch('js-flags', '--max-executable-size=192', '--max-old-space-size=8192', '--max-semi-space-size=2')
app.commandLine.appendSwitch('js-flags', '--max-executable-size=192 --max-old-space-size=8192 --max-semi-space-size=2')
log.info("Memory Size Is 16GB Using JS Memory Heap Size 8GB")
} else if (myMemory > 12000000000) {
app.commandLine.appendSwitch('js-flags', '--max-executable-size=192', '--max-old-space-size=6144', '--max-semi-space-size=2')
app.commandLine.appendSwitch('js-flags', '--max-executable-size=192 --max-old-space-size=6144 --max-semi-space-size=2')
log.info("Memory Size Is 12GB Using JS Memory Heap Size 6GB")
} else if (myMemory > 7000000000) {
app.commandLine.appendSwitch('js-flags', '--max-executable-size=192', '--max-old-space-size=4096', '--max-semi-space-size=2')
app.commandLine.appendSwitch('js-flags', '--max-executable-size=192 --max-old-space-size=4096 --max-semi-space-size=2')
log.info("Memory Size Is 8GB Using JS Memory Heap Size 4GB")
} else {
app.commandLine.appendSwitch('js-flags', '--max-executable-size=192', '--max-old-space-size=2048', '--max-semi-space-size=2')
app.commandLine.appendSwitch('js-flags', '--max-executable-size=192 --max-old-space-size=2048 --max-semi-space-size=2')
log.info("Memory Size Is 4GB Using JS Memory Heap Size 2GB")
}
@ -168,15 +164,11 @@ const isRunning = (query, cb) => {
}
function doesFileExist(urlToJavaFile) {
var xhr = new XMLHttpRequest()
const xhr = new XMLHttpRequest();
xhr.open('HEAD', urlToJavaFile, true)
xhr.send()
if (xhr.status == "404") {
return false
} else {
return true
}
return xhr.status != "404";
}
async function checkWin() {
@ -201,7 +193,7 @@ async function checkWin() {
store.set('askingCore', returnValue.checkboxChecked)
} else {
store.set('askingCore', returnValue.checkboxChecked)
return
}
})
}
@ -219,7 +211,7 @@ async function checkWin() {
if (returnValue.response === 0) {
downloadWindows()
} else {
return
}
})
}
@ -227,11 +219,11 @@ async function checkWin() {
async function checkOsPlatform() {
if (process.platform === 'win32') {
startElectronWin()
await startElectronWin()
} else if (process.platform === 'linux' || process.platform === 'darwin') {
startElectronUnix()
} else {
return
}
}
@ -256,7 +248,7 @@ async function startElectronWin() {
if (returnValue.response === 0) {
downloadWindows()
} else {
return
}
})
}
@ -283,7 +275,7 @@ function startElectronUnix() {
if (returnValue.response === 0) {
downloadQortal()
} else {
return
}
})
}
@ -298,7 +290,7 @@ async function downloadWindows() {
alwaysOnTop: true,
show: false
})
winLoader.loadFile(path.join(__dirname + '/splash/download.html'))
await winLoader.loadFile(path.join(__dirname + '/splash/download.html'))
winLoader.show()
await electronDl.download(myWindow, winurl, {
@ -329,7 +321,7 @@ async function removeQortalExe() {
log.info('renove error', err)
}
checkWin()
await checkWin()
}
async function checkPort() {
@ -344,7 +336,7 @@ async function checkPort() {
async function checkResponseStatus(res) {
if (res.ok) {
return
} else if (process.platform === 'win32') {
await checkWin()
} else {
@ -353,7 +345,7 @@ async function checkResponseStatus(res) {
}
async function javaversion() {
var stderrChunks = []
let stderrChunks = [];
let checkJava = await spawn('java', ['-version'], { shell: true })
if (process.platform === 'linux') {
if (process.arch === 'x64') {
@ -386,8 +378,8 @@ async function javaversion() {
})
checkJava.stderr.on('end', () => {
datres = Buffer.concat(stderrChunks).toString().split('\n')[0]
var javaVersion = new RegExp('(java|openjdk) version').test(datres) ? datres.split(' ')[2].replace(/"/g, '') : false
let datres = Buffer.concat(stderrChunks).toString().split('\n')[0]
const javaVersion = new RegExp('(java|openjdk) version').test(datres) ? datres.split(' ')[2].replace(/"/g, '') : false;
log.info("Java Version", javaVersion)
if (javaVersion != false) {
checkQortal()
@ -403,7 +395,7 @@ async function javaversion() {
if (returnValue.response === 0) {
installJava()
} else {
return
}
})
}
@ -419,7 +411,7 @@ async function installJava() {
alwaysOnTop: true,
show: false
})
splashLoader.loadFile(path.join(__dirname + '/splash/download.html'))
await splashLoader.loadFile(path.join(__dirname + '/splash/download.html'))
if (process.platform === 'linux') {
if (process.arch === 'x64') {
@ -435,7 +427,7 @@ async function installJava() {
log.info('Download JAVA error', err)
}
splashLoader.destroy()
unzipJavaX64Linux()
await unzipJavaX64Linux()
} else {
try {
splashLoader.show()
@ -448,7 +440,7 @@ async function installJava() {
log.info('Download JAVA error', err)
}
splashLoader.destroy()
unzipJavaX64Linux()
await unzipJavaX64Linux()
}
} else if (process.arch === 'arm64') {
if (doesFileExist(linjavaarm64url) == true) {
@ -463,7 +455,7 @@ async function installJava() {
log.info('Download JAVA error', err)
}
splashLoader.destroy()
unzipJavaArm64Linux()
await unzipJavaArm64Linux()
} else {
try {
splashLoader.show()
@ -476,7 +468,7 @@ async function installJava() {
log.info('Download JAVA error', err)
}
splashLoader.destroy()
unzipJavaArm64Linux()
await unzipJavaArm64Linux()
}
} else if (process.arch === 'arm') {
if (doesFileExist(linjavaarmurl) == true) {
@ -491,7 +483,7 @@ async function installJava() {
log.info('Download JAVA error', err)
}
splashLoader.destroy()
unzipJavaArmLinux()
await unzipJavaArmLinux()
} else {
try {
splashLoader.show()
@ -504,7 +496,7 @@ async function installJava() {
log.info('Download JAVA error', err)
}
splashLoader.destroy()
unzipJavaArmLinux()
await unzipJavaArmLinux()
}
}
} else if (process.platform === 'darwin') {
@ -521,7 +513,7 @@ async function installJava() {
log.info('Download JAVA error', err)
}
splashLoader.destroy()
unzipJavaX64Mac()
await unzipJavaX64Mac()
} else {
try {
splashLoader.show()
@ -534,7 +526,7 @@ async function installJava() {
log.info('Download JAVA error', err)
}
splashLoader.destroy()
unzipJavaX64Mac()
await unzipJavaX64Mac()
}
} else {
if (doesFileExist(macjavaaarch64url) == true) {
@ -549,7 +541,7 @@ async function installJava() {
log.info('Download JAVA error', err)
}
splashLoader.destroy()
unzipJavaAarch64Mac()
await unzipJavaAarch64Mac()
} else {
try {
splashLoader.show()
@ -562,7 +554,7 @@ async function installJava() {
log.info('Download JAVA error', err)
}
splashLoader.destroy()
unzipJavaAarch64Mac()
await unzipJavaAarch64Mac()
}
}
}
@ -575,7 +567,7 @@ async function unzipJavaX64Linux() {
} catch (err) {
log.info('Unzip Java error', err)
}
chmodJava()
await chmodJava()
}
async function unzipJavaArm64Linux() {
@ -585,7 +577,7 @@ async function unzipJavaArm64Linux() {
} catch (err) {
log.info('Unzip Java error', err)
}
chmodJava()
await chmodJava()
}
async function unzipJavaArmLinux() {
@ -595,7 +587,7 @@ async function unzipJavaArmLinux() {
} catch (err) {
log.info('Unzip Java error', err)
}
chmodJava()
await chmodJava()
}
async function unzipJavaX64Mac() {
@ -605,7 +597,7 @@ async function unzipJavaX64Mac() {
} catch (err) {
log.info('Unzip Java error', err)
}
chmodJava()
await chmodJava()
}
async function unzipJavaAarch64Mac() {
@ -615,7 +607,7 @@ async function unzipJavaAarch64Mac() {
} catch (err) {
log.info('Unzip Java error', err)
}
chmodJava()
await chmodJava()
}
async function chmodJava() {
@ -627,7 +619,7 @@ async function chmodJava() {
} catch (err) {
log.info('chmod error', err)
}
removeJavaZip()
await removeJavaZip()
}
async function removeJavaZip() {
@ -710,7 +702,7 @@ function checkQortal() {
store.set('askingCore', returnValue.checkboxChecked)
} else {
store.set('askingCore', returnValue.checkboxChecked)
return
}
})
}
@ -728,7 +720,7 @@ function checkQortal() {
if (returnValue.response === 0) {
downloadQortal()
} else {
return
}
})
}
@ -743,7 +735,7 @@ async function downloadQortal() {
alwaysOnTop: true,
show: false
})
qortalLoader.loadFile(path.join(__dirname + '/splash/download.html'))
await qortalLoader.loadFile(path.join(__dirname + '/splash/download.html'))
try {
qortalLoader.show()
@ -756,7 +748,7 @@ async function downloadQortal() {
log.info('Download Qortal error', err)
}
qortalLoader.destroy()
unzipQortal()
await unzipQortal()
}
async function unzipQortal() {
@ -766,7 +758,7 @@ async function unzipQortal() {
} catch (err) {
log.info('Unzip Qortal error', err)
}
chmodQortal()
await chmodQortal()
}
async function chmodQortal() {
@ -778,7 +770,7 @@ async function chmodQortal() {
} catch (err) {
log.info('chmod error', err)
}
removeQortalZip()
await removeQortalZip()
}
async function removeQortalZip() {
@ -790,7 +782,7 @@ async function removeQortalZip() {
} catch (err) {
log.info('rm error', err)
}
checkAndStart()
await checkAndStart()
}
async function checkAndStart() {
@ -811,7 +803,7 @@ async function checkAndStart() {
store.set('askingCore', returnValue.checkboxChecked)
} else {
store.set('askingCore', returnValue.checkboxChecked)
return
}
})
}
@ -990,7 +982,7 @@ const editMenu = Menu.buildFromTemplate([
store.set('askingCore', returnValue.checkboxChecked)
} else {
store.set('askingCore', returnValue.checkboxChecked)
return
}
})
}
@ -1147,7 +1139,7 @@ const createTray = () => {
store.set('askingCore', returnValue.checkboxChecked)
} else {
store.set('askingCore', returnValue.checkboxChecked)
return
}
})
},
@ -1208,8 +1200,10 @@ if (!isLock) {
app.whenReady().then(async () => {
createWindow()
createTray()
await checkAll()
autoUpdater.checkForUpdatesAndNotify()
if (!store.get('askingCore')) {
await checkAll()
}
await autoUpdater.checkForUpdatesAndNotify()
setInterval(() => {
autoUpdater.checkForUpdatesAndNotify()
}, 1000 * 60 * 720)
@ -1245,7 +1239,7 @@ if (!isLock) {
store.set('askingCore', returnValue.checkboxChecked)
} else {
store.set('askingCore', returnValue.checkboxChecked)
return
}
})
})
@ -1331,7 +1325,7 @@ if (!isLock) {
})
dl.show()
} else {
return
}
})
})
@ -1353,7 +1347,7 @@ if (!isLock) {
if (returnValue.response === 0) {
autoUpdater.quitAndInstall()
} else {
return
}
})
})
@ -1374,4 +1368,4 @@ if (!isLock) {
process.on('uncaughtException', function (err) {
log.info("*** WHOOPS TIME ***" + err)
})
}
}

View File

@ -1,71 +0,0 @@
#!/bin/sh
# Qortal Blockchain Project - 2021
# Travis Script to install dependencies...
set -ev
# install every repository needed, install dependencies, clone git repos, do yarn linking and building, and build and run final UI
install_dependencies()
{
echo -e '---INSTALLING DEPENDENCIES!---'
echo -e '---INSTALLING ALL UI REPOSITORIES---'
cd ../
cd qortal-ui-core
yarn install --pure-lockfile
cd ../
mkdir qortal-ui/qortal-ui-core
rsync -a qortal-ui-core/ qortal-ui/qortal-ui-core --exclude .git
cd qortal-ui/qortal-ui-core
yarn link
cd ../../
cd qortal-ui-plugins
yarn install --pure-lockfile
cd ../
mkdir qortal-ui/qortal-ui-plugins
rsync -a qortal-ui-plugins/ qortal-ui/qortal-ui-plugins --exclude .git
cd qortal-ui/qortal-ui-plugins
yarn link
cd ../../
cd qortal-ui-crypto
yarn install --pure-lockfile
cd ../
mkdir qortal-ui/qortal-ui-crypto
rsync -a qortal-ui-crypto/ qortal-ui/qortal-ui-crypto --exclude .git
cd qortal-ui/qortal-ui-crypto
yarn link
cd ../
echo -e '---INSTALL ALL DEPENDENCIES---'
yarn install --pure-lockfile
echo -e '---LINKING UI FOLDERS ---'
yarn link qortal-ui-core
yarn link qortal-ui-crypto
yarn link qortal-ui-plugins
echo -e '---BUILDING UI DEPENDENCIES!---'
yarn build
echo -e '---UPDATE PACKAGE-JSON UI DEPENDENCIES!---'
yarn update-package-json
echo -e '---REMOVE MODULES AND UNUSED DEPENDENCIES!---'
cd qortal-ui-core
yarn install --production --ignore-scripts --prefer-offline
cd ../
cd qortal-ui-plugins
rm -R node_modules
cd ../
cd qortal-ui-crypto
rm -R node_modules
cd ../
rm -R qortal-ui-crypto
}
install_dependencies

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