mirror of
https://github.com/Qortal/qortal-ui.git
synced 2025-02-11 17:55:51 +00:00
Merge remote-tracking branch 'main/master' into ugfix/reply-name-and-limit-websocket
This commit is contained in:
commit
43d19cf8d7
350
electron.js
350
electron.js
@ -6,12 +6,14 @@ const path = require('path')
|
||||
const i18n = require('./lib/i18n.js')
|
||||
const fs = require('fs')
|
||||
const electronDl = require('electron-dl')
|
||||
const Store = require('electron-store')
|
||||
const extract = require('extract-zip')
|
||||
const fetch = require('node-fetch')
|
||||
const child = require('child_process').execFile
|
||||
const execFile = require('child_process').execFile
|
||||
const exec = require('child_process').exec
|
||||
const spawn = require('child_process').spawn
|
||||
|
||||
app.commandLine.appendSwitch('enable-experimental-web-platform-features')
|
||||
app.disableHardwareAcceleration()
|
||||
app.enableSandbox()
|
||||
electronDl()
|
||||
@ -19,20 +21,26 @@ electronDl()
|
||||
process.env['APP_PATH'] = app.getAppPath()
|
||||
|
||||
const homePath = app.getPath('home')
|
||||
const downloadPath = app.getPath('downloads')
|
||||
const store = new Store()
|
||||
|
||||
autoUpdater.autoDownload = false
|
||||
autoUpdater.autoInstallOnAppQuit = false
|
||||
autoUpdater.logger = log
|
||||
autoUpdater.logger.transports.file.level = 'info'
|
||||
|
||||
if(!store.has('askingCore')) {
|
||||
store.set('askingCore', false)
|
||||
}
|
||||
|
||||
log.info('App starting...')
|
||||
log.info('App Platform is', process.platform)
|
||||
log.info('Platform arch is', process.arch)
|
||||
log.info("ASKING CORE", store.get('askingCore'))
|
||||
|
||||
const winjar = String.raw`C:\Program Files\Qortal\qortal.jar`
|
||||
const windir = String.raw`C:\Qortal`
|
||||
const winurl = "https://github.com/Qortal/qortal/releases/latest/download/qortal.exe"
|
||||
const winexe = "C:\\Qortal\\qortal.exe"
|
||||
const winexe = downloadPath + "\\qortal.exe"
|
||||
const startWinCore = "C:\\Program Files\\Qortal\\qortal.exe"
|
||||
|
||||
const zipdir = homePath
|
||||
@ -84,6 +92,52 @@ const isRunning = (query, cb) => {
|
||||
})
|
||||
}
|
||||
|
||||
async function checkWin() {
|
||||
if (fs.existsSync(winjar)) {
|
||||
isRunning('qortal.exe', (status) => {
|
||||
if (status == true) {
|
||||
log.info("Core is running, perfect !")
|
||||
} else {
|
||||
if (!store.get('askingCore')) {
|
||||
const dialogOpts = {
|
||||
type: 'info',
|
||||
buttons: [i18n.__("electron_translate_13"), i18n.__("electron_translate_14")],
|
||||
title: i18n.__("electron_translate_15"),
|
||||
message: i18n.__("electron_translate_16"),
|
||||
detail: i18n.__("electron_translate_17"),
|
||||
checkboxLabel: i18n.__("electron_translate_28"),
|
||||
checkboxChecked: false
|
||||
}
|
||||
dialog.showMessageBox(dialogOpts).then((returnValue) => {
|
||||
if (returnValue.response === 0) {
|
||||
spawn(startWinCore, { detached: true })
|
||||
store.set('askingCore', returnValue.checkboxChecked)
|
||||
} else {
|
||||
store.set('askingCore', returnValue.checkboxChecked)
|
||||
return
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
const dialogOpts = {
|
||||
type: 'info',
|
||||
buttons: [i18n.__("electron_translate_18"), i18n.__("electron_translate_19")],
|
||||
title: i18n.__("electron_translate_20"),
|
||||
message: i18n.__("electron_translate_21"),
|
||||
detail: i18n.__("electron_translate_22")
|
||||
}
|
||||
dialog.showMessageBox(dialogOpts).then((returnValue) => {
|
||||
if (returnValue.response === 0) {
|
||||
downloadWindows()
|
||||
} else {
|
||||
return
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
async function downloadWindows() {
|
||||
let winLoader = new BrowserWindow({
|
||||
width: 500,
|
||||
@ -97,17 +151,34 @@ async function downloadWindows() {
|
||||
|
||||
winLoader.show()
|
||||
await electronDl.download(myWindow, winurl, {
|
||||
directory: windir,
|
||||
onProgress: function () { log.info("Starting Download Windows Installer") }
|
||||
directory: downloadPath,
|
||||
onProgress: function () { log.info("Starting Download Qortal Core Installer") }
|
||||
})
|
||||
winLoader.destroy()
|
||||
child(winexe, function (err, data) {
|
||||
if (err) {
|
||||
log.info(err)
|
||||
return
|
||||
|
||||
const coreInstall = execFile(winexe, (e, stdout, stderr) => {
|
||||
if (e) {
|
||||
log.info(e)
|
||||
removeQortalExe()
|
||||
} else {
|
||||
log.info('Qortal Core Installation Done', stdout, stderr)
|
||||
removeQortalExe()
|
||||
}
|
||||
log.info(data.toString())
|
||||
})
|
||||
|
||||
coreInstall.stdin.end()
|
||||
}
|
||||
|
||||
async function removeQortalExe() {
|
||||
try {
|
||||
await fs.rmSync(winexe, {
|
||||
force: true,
|
||||
})
|
||||
} catch (err) {
|
||||
log.info('renove error', err)
|
||||
}
|
||||
|
||||
checkWin()
|
||||
}
|
||||
|
||||
async function checkPort() {
|
||||
@ -123,6 +194,8 @@ async function checkPort() {
|
||||
async function checkResponseStatus(res) {
|
||||
if (res.ok) {
|
||||
return
|
||||
} else if (process.platform === 'win32') {
|
||||
await checkWin()
|
||||
} else {
|
||||
await javaversion()
|
||||
}
|
||||
@ -395,21 +468,26 @@ function checkQortal() {
|
||||
if (status == true) {
|
||||
log.info("Core is running, perfect !")
|
||||
} else {
|
||||
log.info("Core is not running, starting it !")
|
||||
const dialogOpts = {
|
||||
type: 'info',
|
||||
buttons: [i18n.__("electron_translate_13"), i18n.__("electron_translate_14")],
|
||||
title: i18n.__("electron_translate_15"),
|
||||
message: i18n.__("electron_translate_16"),
|
||||
detail: i18n.__("electron_translate_17")
|
||||
}
|
||||
dialog.showMessageBox(dialogOpts).then((returnValue) => {
|
||||
if (returnValue.response === 0) {
|
||||
startQortal()
|
||||
} else {
|
||||
return
|
||||
if (!store.get('askingCore')) {
|
||||
const dialogOpts = {
|
||||
type: 'info',
|
||||
buttons: [i18n.__("electron_translate_13"), i18n.__("electron_translate_14")],
|
||||
title: i18n.__("electron_translate_15"),
|
||||
message: i18n.__("electron_translate_16"),
|
||||
detail: i18n.__("electron_translate_17"),
|
||||
checkboxLabel: i18n.__("electron_translate_28"),
|
||||
checkboxChecked: false
|
||||
}
|
||||
})
|
||||
dialog.showMessageBox(dialogOpts).then((returnValue) => {
|
||||
if (returnValue.response === 0) {
|
||||
startQortal()
|
||||
store.set('askingCore', returnValue.checkboxChecked)
|
||||
} else {
|
||||
store.set('askingCore', returnValue.checkboxChecked)
|
||||
return
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
@ -491,20 +569,26 @@ async function removeQortalZip() {
|
||||
|
||||
async function checkAndStart() {
|
||||
try {
|
||||
const dialogOpts = {
|
||||
type: 'info',
|
||||
buttons: [i18n.__("electron_translate_13"), i18n.__("electron_translate_14")],
|
||||
title: i18n.__("electron_translate_15"),
|
||||
message: i18n.__("electron_translate_16"),
|
||||
detail: i18n.__("electron_translate_17")
|
||||
}
|
||||
dialog.showMessageBox(dialogOpts).then((returnValue) => {
|
||||
if (returnValue.response === 0) {
|
||||
startQortal()
|
||||
} else {
|
||||
return
|
||||
if (!store.get('askingCore')) {
|
||||
const dialogOpts = {
|
||||
type: 'info',
|
||||
buttons: [i18n.__("electron_translate_13"), i18n.__("electron_translate_14")],
|
||||
title: i18n.__("electron_translate_15"),
|
||||
message: i18n.__("electron_translate_16"),
|
||||
detail: i18n.__("electron_translate_17"),
|
||||
checkboxLabel: i18n.__("electron_translate_28"),
|
||||
checkboxChecked: false
|
||||
}
|
||||
})
|
||||
dialog.showMessageBox(dialogOpts).then((returnValue) => {
|
||||
if (returnValue.response === 0) {
|
||||
startQortal()
|
||||
store.set('askingCore', returnValue.checkboxChecked)
|
||||
} else {
|
||||
store.set('askingCore', returnValue.checkboxChecked)
|
||||
return
|
||||
}
|
||||
})
|
||||
}
|
||||
} catch (err) {
|
||||
log.info('Sed error', err)
|
||||
}
|
||||
@ -516,8 +600,8 @@ async function startQortal() {
|
||||
if (fs.existsSync(linjavax64bindir)) {
|
||||
try {
|
||||
await spawn(
|
||||
linjavax64binfile, ['-Djava.net.preferIPv4Stack=false', '-Xss1250k', '-Xmx2200m', '-jar', qortaljar, qortalsettings, '1>run.log', '2>&1', '&'],
|
||||
{ cwd: qortaldir }
|
||||
'nohup', ['nice', '-n', '20', linjavax64binfile, '-Djava.net.preferIPv4Stack=false', '-jar', qortaljar, qortalsettings, '1>run.log', '2>&1', '&'],
|
||||
{ cwd: qortaldir, shell: true, detached: true }
|
||||
)
|
||||
} catch (err) {
|
||||
log.info('Start qortal error', err)
|
||||
@ -525,8 +609,8 @@ async function startQortal() {
|
||||
} else {
|
||||
try {
|
||||
await spawn(
|
||||
'java', ['-Djava.net.preferIPv4Stack=false', '-Xss1250k', '-Xmx2200m', '-jar', qortaljar, qortalsettings, '1>run.log', '2>&1', '&'],
|
||||
{ cwd: qortaldir }
|
||||
'nohup', ['nice', '-n', '20', 'java', '-Djava.net.preferIPv4Stack=false', '-jar', qortaljar, qortalsettings, '1>run.log', '2>&1', '&'],
|
||||
{ cwd: qortaldir, shell: true, detached: true }
|
||||
)
|
||||
} catch (err) {
|
||||
log.info('Start qortal error', err)
|
||||
@ -536,8 +620,8 @@ async function startQortal() {
|
||||
if (fs.existsSync(linjavaarm64bindir)) {
|
||||
try {
|
||||
await spawn(
|
||||
linjavaarm64binfile, ['-Djava.net.preferIPv4Stack=false', '-Xss1250k', '-Xmx2200m', '-jar', qortaljar, qortalsettings, '1>run.log', '2>&1', '&'],
|
||||
{ cwd: qortaldir }
|
||||
'nohup', ['nice', '-n', '20', linjavaarm64binfile, '-Djava.net.preferIPv4Stack=false', '-jar', qortaljar, qortalsettings, '1>run.log', '2>&1', '&'],
|
||||
{ cwd: qortaldir, shell: true, detached: true }
|
||||
)
|
||||
} catch (err) {
|
||||
log.info('Start qortal error', err)
|
||||
@ -545,8 +629,8 @@ async function startQortal() {
|
||||
} else {
|
||||
try {
|
||||
await spawn(
|
||||
'java', ['-Djava.net.preferIPv4Stack=false', '-Xss1250k', '-Xmx2200m', '-jar', qortaljar, qortalsettings, '1>run.log', '2>&1', '&'],
|
||||
{ cwd: qortaldir }
|
||||
'nohup', ['nice', '-n', '20', 'java', '-Djava.net.preferIPv4Stack=false', '-jar', qortaljar, qortalsettings, '1>run.log', '2>&1', '&'],
|
||||
{ cwd: qortaldir, shell: true, detached: true }
|
||||
)
|
||||
} catch (err) {
|
||||
log.info('Start qortal error', err)
|
||||
@ -556,8 +640,8 @@ async function startQortal() {
|
||||
if (fs.existsSync(linjavaarmbindir)) {
|
||||
try {
|
||||
await spawn(
|
||||
linjavaarmbinfile, ['-Djava.net.preferIPv4Stack=false', '-Xss1250k', '-Xmx2200m', '-jar', qortaljar, qortalsettings, '1>run.log', '2>&1', '&'],
|
||||
{ cwd: qortaldir }
|
||||
'nohup', ['nice', '-n', '20', linjavaarmbinfile, '-Djava.net.preferIPv4Stack=false', '-jar', qortaljar, qortalsettings, '1>run.log', '2>&1', '&'],
|
||||
{ cwd: qortaldir, shell: true, detached: true }
|
||||
)
|
||||
} catch (err) {
|
||||
log.info('Start qortal error', err)
|
||||
@ -565,8 +649,8 @@ async function startQortal() {
|
||||
} else {
|
||||
try {
|
||||
await spawn(
|
||||
'java', ['-Djava.net.preferIPv4Stack=false', '-Xss1250k', '-Xmx2200m', '-jar', qortaljar, qortalsettings, '1>run.log', '2>&1', '&'],
|
||||
{ cwd: qortaldir }
|
||||
'nohup', ['nice', '-n', '20', 'java', '-Djava.net.preferIPv4Stack=false', '-jar', qortaljar, qortalsettings, '1>run.log', '2>&1', '&'],
|
||||
{ cwd: qortaldir, shell: true, detached: true }
|
||||
)
|
||||
} catch (err) {
|
||||
log.info('Start qortal error', err)
|
||||
@ -578,8 +662,8 @@ async function startQortal() {
|
||||
if (fs.existsSync(macjavax64bindir)) {
|
||||
try {
|
||||
await spawn(
|
||||
macjavax64binfile, ['-Djava.net.preferIPv4Stack=false', '-Xss1250k', '-Xmx2200m', '-jar', qortaljar, qortalsettings, '1>run.log', '2>&1', '&'],
|
||||
{ cwd: qortaldir }
|
||||
'nohup', ['nice', '-n', '20', macjavax64binfile, '-Djava.net.preferIPv4Stack=false', '-jar', qortaljar, qortalsettings, '1>run.log', '2>&1', '&'],
|
||||
{ cwd: qortaldir, shell: true, detached: true }
|
||||
)
|
||||
} catch (err) {
|
||||
log.info('Start qortal error', err)
|
||||
@ -587,8 +671,8 @@ async function startQortal() {
|
||||
} else {
|
||||
try {
|
||||
await spawn(
|
||||
'java', ['-Djava.net.preferIPv4Stack=false', '-Xss1250k', '-Xmx2200m', '-jar', qortaljar, qortalsettings, '1>run.log', '2>&1', '&'],
|
||||
{ cwd: qortaldir }
|
||||
'nohup', ['nice', '-n', '20', 'java', '-Djava.net.preferIPv4Stack=false', '-jar', qortaljar, qortalsettings, '1>run.log', '2>&1', '&'],
|
||||
{ cwd: qortaldir, shell: true, detached: true }
|
||||
)
|
||||
} catch (err) {
|
||||
log.info('Start qortal error', err)
|
||||
@ -598,8 +682,8 @@ async function startQortal() {
|
||||
if (fs.existsSync(macjavaaarch64bindir)) {
|
||||
try {
|
||||
await spawn(
|
||||
macjavaaarch64binfile, ['-Djava.net.preferIPv4Stack=false', '-Xss1250k', '-Xmx2200m', '-jar', qortaljar, qortalsettings, '1>run.log', '2>&1', '&'],
|
||||
{ cwd: qortaldir }
|
||||
'nohup', ['nice', '-n', '20', macjavaaarch64binfile, '-Djava.net.preferIPv4Stack=false', '-jar', qortaljar, qortalsettings, '1>run.log', '2>&1', '&'],
|
||||
{ cwd: qortaldir, shell: true, detached: true }
|
||||
)
|
||||
} catch (err) {
|
||||
log.info('Start qortal error', err)
|
||||
@ -607,8 +691,8 @@ async function startQortal() {
|
||||
} else {
|
||||
try {
|
||||
await spawn(
|
||||
'java', ['-Djava.net.preferIPv4Stack=false', '-Xss1250k', '-Xmx2200m', '-jar', qortaljar, qortalsettings, '1>run.log', '2>&1', '&'],
|
||||
{ cwd: qortaldir }
|
||||
'nohup', ['nice', '-n', '20', 'java', '-Djava.net.preferIPv4Stack=false', '-jar', qortaljar, qortalsettings, '1>run.log', '2>&1', '&'],
|
||||
{ cwd: qortaldir, shell: true, detached: true }
|
||||
)
|
||||
} catch (err) {
|
||||
log.info('Start qortal error', err)
|
||||
@ -621,24 +705,50 @@ async function startQortal() {
|
||||
const editMenu = Menu.buildFromTemplate([
|
||||
{
|
||||
label: "Qortal",
|
||||
submenu: [
|
||||
{ label: "Quit", click() {app.quit()}}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: i18n.__("electron_translate_34"),
|
||||
submenu: [{
|
||||
label: "Quit",
|
||||
label: i18n.__("electron_translate_31"),
|
||||
click() {
|
||||
app.quit()
|
||||
const dialogOpts = {
|
||||
type: 'info',
|
||||
noLink: true,
|
||||
buttons: [i18n.__("electron_translate_29"), i18n.__("electron_translate_30")],
|
||||
title: i18n.__("electron_translate_31"),
|
||||
message: i18n.__("electron_translate_32"),
|
||||
detail: i18n.__("electron_translate_33"),
|
||||
checkboxLabel: i18n.__("electron_translate_28"),
|
||||
checkboxChecked: store.get('askingCore')
|
||||
}
|
||||
dialog.showMessageBox(dialogOpts).then((returnValue) => {
|
||||
if (returnValue.response === 0) {
|
||||
store.set('askingCore', returnValue.checkboxChecked)
|
||||
} else {
|
||||
store.set('askingCore', returnValue.checkboxChecked)
|
||||
return
|
||||
}
|
||||
})
|
||||
}
|
||||
}]
|
||||
},
|
||||
{
|
||||
label: "Edit",
|
||||
submenu: [
|
||||
{ label: "Undo", accelerator: "CommandOrControl+Z", selector: "undo:" },
|
||||
{ label: "Redo", accelerator: "CommandOrControl+Shift+Z", selector: "redo:" },
|
||||
{ label: "Undo", accelerator: "CmdOrCtrl+Z", selector: "undo:" },
|
||||
{ label: "Redo", accelerator: "Shift+CmdOrCtrl+Z", selector: "redo:" },
|
||||
{ type: "separator" },
|
||||
{ label: "Cut", accelerator: "CommandOrControl+X", selector: "cut:" },
|
||||
{ label: "Copy", accelerator: "CommandOrControl+C", selector: "copy:" },
|
||||
{ label: "Paste", accelerator: "CommandOrControl+V", selector: "paste:" },
|
||||
{ label: "Select All", accelerator: "CommandOrControl+A", selector: "selectAll:" }
|
||||
{ label: "Cut", accelerator: "CmdOrCtrl+X", selector: "cut:" },
|
||||
{ label: "Copy", accelerator: "CmdOrCtrl+C", selector: "copy:" },
|
||||
{ label: "Paste", accelerator: "CmdOrCtrl+V", selector: "paste:" },
|
||||
{ label: "Select All", accelerator: "CmdOrCtrl+A", selector: "selectAll:" }
|
||||
]
|
||||
},
|
||||
{
|
||||
label: "Check for update", click() {autoUpdater.checkForUpdatesAndNotify()}
|
||||
}
|
||||
])
|
||||
|
||||
@ -657,10 +767,13 @@ function createWindow() {
|
||||
title: "Qortal UI",
|
||||
autoHideMenuBar: true,
|
||||
webPreferences: {
|
||||
nodeIntegration: true,
|
||||
nodeIntegrationInWorker: true,
|
||||
partition: 'persist:webviewsession',
|
||||
enableRemoteModule: false
|
||||
nodeIntegration: false,
|
||||
contextIsolation: true,
|
||||
enableRemoteModule: false,
|
||||
allowRunningInsecureContent: false,
|
||||
experimentalFeatures: false,
|
||||
preload: path.join(__dirname, '/lib/preload.js')
|
||||
},
|
||||
show: false
|
||||
})
|
||||
@ -697,6 +810,32 @@ const createTray = () => {
|
||||
{
|
||||
type: 'separator',
|
||||
},
|
||||
{
|
||||
label: i18n.__("electron_translate_31"),
|
||||
click: function () {
|
||||
const dialogOpts = {
|
||||
type: 'info',
|
||||
noLink: true,
|
||||
buttons: [i18n.__("electron_translate_29"), i18n.__("electron_translate_30")],
|
||||
title: i18n.__("electron_translate_31"),
|
||||
message: i18n.__("electron_translate_32"),
|
||||
detail: i18n.__("electron_translate_33"),
|
||||
checkboxLabel: i18n.__("electron_translate_28"),
|
||||
checkboxChecked: store.get('askingCore')
|
||||
}
|
||||
dialog.showMessageBox(dialogOpts).then((returnValue) => {
|
||||
if (returnValue.response === 0) {
|
||||
store.set('askingCore', returnValue.checkboxChecked)
|
||||
} else {
|
||||
store.set('askingCore', returnValue.checkboxChecked)
|
||||
return
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'separator',
|
||||
},
|
||||
{
|
||||
label: i18n.__("electron_translate_1"),
|
||||
click: function () {
|
||||
@ -721,50 +860,7 @@ const createTray = () => {
|
||||
async function checkAll() {
|
||||
if (process.platform === 'win32') {
|
||||
app.setAppUserModelId("org.qortal.QortalUI")
|
||||
if (fs.existsSync(winjar)) {
|
||||
isRunning('qortal.exe', (status) => {
|
||||
if (status == true) {
|
||||
log.info("Core is running, perfect !")
|
||||
} else {
|
||||
log.info("Core is not running, starting it !")
|
||||
const dialogOpts = {
|
||||
type: 'info',
|
||||
buttons: [i18n.__("electron_translate_13"), i18n.__("electron_translate_14")],
|
||||
title: i18n.__("electron_translate_15"),
|
||||
message: i18n.__("electron_translate_16"),
|
||||
detail: i18n.__("electron_translate_17")
|
||||
}
|
||||
dialog.showMessageBox(dialogOpts).then((returnValue) => {
|
||||
if (returnValue.response === 0) {
|
||||
child(startWinCore, function (err, data) {
|
||||
if (err) {
|
||||
log.info(err)
|
||||
return
|
||||
}
|
||||
log.info(data.toString())
|
||||
})
|
||||
} else {
|
||||
return
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
const dialogOpts = {
|
||||
type: 'info',
|
||||
buttons: [i18n.__("electron_translate_18"), i18n.__("electron_translate_19")],
|
||||
title: i18n.__("electron_translate_20"),
|
||||
message: i18n.__("electron_translate_21"),
|
||||
detail: i18n.__("electron_translate_22")
|
||||
}
|
||||
dialog.showMessageBox(dialogOpts).then((returnValue) => {
|
||||
if (returnValue.response === 0) {
|
||||
downloadWindows()
|
||||
} else {
|
||||
return
|
||||
}
|
||||
})
|
||||
}
|
||||
await checkPort()
|
||||
} else if (process.platform === 'darwin') {
|
||||
await checkPort()
|
||||
} else if (process.platform === 'linux') {
|
||||
@ -814,6 +910,29 @@ if (!isLock) {
|
||||
log.info(app.getVersion())
|
||||
myWindow.webContents.send('app_version', { version: app.getVersion() })
|
||||
})
|
||||
ipcMain.on('set-start-core', (event) => {
|
||||
const dialogOpts = {
|
||||
type: 'info',
|
||||
noLink: true,
|
||||
buttons: [i18n.__("electron_translate_29"), i18n.__("electron_translate_30")],
|
||||
title: i18n.__("electron_translate_31"),
|
||||
message: i18n.__("electron_translate_32"),
|
||||
detail: i18n.__("electron_translate_33"),
|
||||
checkboxLabel: i18n.__("electron_translate_28"),
|
||||
checkboxChecked: store.get('askingCore')
|
||||
}
|
||||
dialog.showMessageBox(dialogOpts).then((returnValue) => {
|
||||
if (returnValue.response === 0) {
|
||||
store.set('askingCore', returnValue.checkboxChecked)
|
||||
} else {
|
||||
store.set('askingCore', returnValue.checkboxChecked)
|
||||
return
|
||||
}
|
||||
})
|
||||
})
|
||||
ipcMain.on('check-for-update', (event) => {
|
||||
autoUpdater.checkForUpdatesAndNotify()
|
||||
})
|
||||
autoUpdater.on('update-available', (event) => {
|
||||
const downloadOpts = {
|
||||
type: 'info',
|
||||
@ -834,6 +953,13 @@ if (!isLock) {
|
||||
}
|
||||
})
|
||||
})
|
||||
autoUpdater.on('update-not-available', (event) => {
|
||||
const noUpdate = new Notification({
|
||||
title: 'Checking for update',
|
||||
body: 'No update available, you are on latest version.'
|
||||
})
|
||||
noUpdate.show()
|
||||
})
|
||||
autoUpdater.on('download-progress', (progressObj) => {
|
||||
myWindow.webContents.send('downloadProgress', progressObj)
|
||||
})
|
||||
|
6
lib/preload.js
Normal file
6
lib/preload.js
Normal file
@ -0,0 +1,6 @@
|
||||
const { contextBridge, ipcRenderer } = require('electron')
|
||||
|
||||
contextBridge.exposeInMainWorld('electronAPI', {
|
||||
setStartCore: () => ipcRenderer.send('set-start-core'),
|
||||
checkForUpdate: () => ipcRenderer.send('check-for-update')
|
||||
})
|
@ -27,5 +27,11 @@
|
||||
"electron_translate_24": "НЕ БЛАГОДАРЯ",
|
||||
"electron_translate_25": "Java не е инсталирана.",
|
||||
"electron_translate_26": "Qortal UI откри, че Java не е инсталирана на вашата система.",
|
||||
"electron_translate_27": "Щракнете върху ИЗТЕГЛЯНЕ на JAVA, за да изтеглите и инсталирате Java, или върху НЕ, БЛАГОДАРЯ, за да не я изтеглите и инсталирате."
|
||||
"electron_translate_27": "Щракнете върху ИЗТЕГЛЯНЕ на JAVA, за да изтеглите и инсталирате Java, или върху НЕ, БЛАГОДАРЯ, за да не я изтеглите и инсталирате.",
|
||||
"electron_translate_28": "Никога повече не ме питай",
|
||||
"electron_translate_29": "ПРОМЯНА НА НАСТРОЙКАТА",
|
||||
"electron_translate_30": "ОТКАЗ",
|
||||
"electron_translate_31": "Стартиране на основните настройки",
|
||||
"electron_translate_32": "Промяна на текущото състояние на запитване за стартиране на ядрото, ако то не работи",
|
||||
"electron_translate_33": "(Поставете отметка или премахнете отметката от квадратчето никога повече да не ме питате)"
|
||||
}
|
@ -27,5 +27,12 @@
|
||||
"electron_translate_24": "NEIN DANKE",
|
||||
"electron_translate_25": "Java ist nicht installiert.",
|
||||
"electron_translate_26": "Qortal UI hat festgestellt, dass Java nicht auf Ihrem System installiert ist.",
|
||||
"electron_translate_27": "Klicken Sie auf JAVA HERUNTERLADEN, um Java herunterzuladen und zu installieren, oder auf NEIN DANKE, um es nicht herunterzuladen und zu installieren."
|
||||
"electron_translate_27": "Klicken Sie auf JAVA HERUNTERLADEN, um Java herunterzuladen und zu installieren, oder auf NEIN DANKE, um es nicht herunterzuladen und zu installieren.",
|
||||
"electron_translate_28": "Frag mich nie wieder",
|
||||
"electron_translate_29": "EINSTELLUNG ÄNDERN",
|
||||
"electron_translate_30": "ABBRECHEN",
|
||||
"electron_translate_31": "Core-Einstellungen starten",
|
||||
"electron_translate_32": "Ändern Sie den aktuellen Status der Aufforderung, den Core zu starten, wenn er nicht läuft",
|
||||
"electron_translate_33": "(Aktivieren oder deaktivieren Sie das Kontrollkästchen Frag mich nie wieder)",
|
||||
"electron_translate_34": "Einstellungen"
|
||||
}
|
@ -27,5 +27,12 @@
|
||||
"electron_translate_24": "NO THANKS",
|
||||
"electron_translate_25": "Java is not installed.",
|
||||
"electron_translate_26": "Qortal UI has detected that java is not installed on your system.",
|
||||
"electron_translate_27": "Click on DOWNLOAD JAVA to download and install java or on NO THANKS to not download and install it."
|
||||
"electron_translate_27": "Click on DOWNLOAD JAVA to download and install java or on NO THANKS to not download and install it.",
|
||||
"electron_translate_28": "Never ask me again",
|
||||
"electron_translate_29": "CHANGE SETTING",
|
||||
"electron_translate_30": "CANCEL",
|
||||
"electron_translate_31": "Start Core Setiings",
|
||||
"electron_translate_32": "Change the current status of asking to start the core if it is not running",
|
||||
"electron_translate_33": "(Check or Uncheck the never ask me again checkbox)",
|
||||
"electron_translate_34": "Settings"
|
||||
}
|
@ -26,6 +26,12 @@
|
||||
"electron_translate_23": "DESCARGAR JAVA",
|
||||
"electron_translate_24": "NO GRACIAS",
|
||||
"electron_translate_25": "Java no está instalado.",
|
||||
"electron_translate_26": "La interfaz de usuario de Qortal ha detectado que Java no está instalado en su sistema".,
|
||||
"electron_translate_27": "Haz clic en DESCARGAR JAVA para descargar e instalar Java o en NO GRACIAS para no descargarlo e instalarlo".
|
||||
"electron_translate_26": "La interfaz de usuario de Qortal ha detectado que Java no está instalado en su sistema.",
|
||||
"electron_translate_27": "Haz clic en DESCARGAR JAVA para descargar e instalar Java o en NO GRACIAS para no descargarlo e instalarlo.",
|
||||
"electron_translate_28": "Nunca me vuelvas a preguntar",
|
||||
"electron_translate_29": "CAMBIAR CONFIGURACIÓN",
|
||||
"electron_translate_30": "CANCELAR",
|
||||
"electron_translate_31": "Iniciar configuración básica",
|
||||
"electron_translate_32": "Cambiar el estado actual de solicitar iniciar el núcleo si no se está ejecutando",
|
||||
"electron_translate_33": "(Marque o desmarque la casilla de verificación Nunca volver a preguntarme)"
|
||||
}
|
@ -27,5 +27,11 @@
|
||||
"electron_translate_24": "NON MERCI",
|
||||
"electron_translate_25": "Java n'est pas installé.",
|
||||
"electron_translate_26": "L'interface utilisateur Qortal a détecté que Java n'est pas installé sur votre système.",
|
||||
"electron_translate_27": "Cliquez sur TÉLÉCHARGER JAVA pour télécharger et installer java ou sur NON MERCI pour ne pas le télécharger et l'installer."
|
||||
"electron_translate_27": "Cliquez sur TÉLÉCHARGER JAVA pour télécharger et installer java ou sur NON MERCI pour ne pas le télécharger et l'installer.",
|
||||
"electron_translate_28": "Ne me demande plus jamais",
|
||||
"electron_translate_29": "MODIFIER LE PARAMÈTRE",
|
||||
"electron_translate_30": "ANNULER",
|
||||
"electron_translate_31": "Démarrer les paramètres de base",
|
||||
"electron_translate_32": "Modifier l'état actuel de la demande de démarrage du noyau s'il n'est pas en cours d'exécution",
|
||||
"electron_translate_33": "(Cochez ou décochez la case Ne plus jamais me demander)"
|
||||
}
|
@ -27,5 +27,11 @@
|
||||
"electron_translate_24": "NO GRAZIE",
|
||||
"electron_translate_25": "Java non è installato.",
|
||||
"electron_translate_26": "Qortal UI ha rilevato che java non è installato sul tuo sistema.",
|
||||
"electron_translate_27": "Clicca su SCARICA JAVA per scaricare e installare java o su NO GRAZIE per non scaricarlo e installarlo."
|
||||
"electron_translate_27": "Clicca su SCARICA JAVA per scaricare e installare java o su NO GRAZIE per non scaricarlo e installarlo.",
|
||||
"electron_translate_28": "Non chiedermelo mai più",
|
||||
"electron_translate_29": "MODIFICA IMPOSTAZIONE",
|
||||
"electron_translate_30": "ANNULLA",
|
||||
"electron_translate_31": "Avvia impostazioni di base",
|
||||
"electron_translate_32": "Cambia lo stato attuale della richiesta di avvio del core se non è in esecuzione",
|
||||
"electron_translate_33": "(Seleziona o deseleziona la casella di controllo Non chiedermelo più)"
|
||||
}
|
@ -27,5 +27,11 @@
|
||||
"electron_translate_24": "고마워요",
|
||||
"electron_translate_25": "자바가 설치되지 않았습니다.",
|
||||
"electron_translate_26": "Qortal UI에서 시스템에 Java가 설치되어 있지 않음을 감지했습니다.",
|
||||
"electron_translate_27": "Java를 다운로드하여 설치하려면 JAVA 다운로드를 클릭하고, 다운로드 및 설치하지 않으려면 NO THANKS를 클릭하십시오."
|
||||
"electron_translate_27": "Java를 다운로드하여 설치하려면 JAVA 다운로드를 클릭하고, 다운로드 및 설치하지 않으려면 NO THANKS를 클릭하십시오.",
|
||||
"electron_translate_28": "다시 묻지 않음",
|
||||
"electron_translate_29": "설정 변경",
|
||||
"electron_translate_30": "취소",
|
||||
"electron_translate_31": "핵심 설정 시작",
|
||||
"electron_translate_32": "코어가 실행 중이 아닌 경우 코어 시작을 요청하는 현재 상태 변경",
|
||||
"electron_translate_33": "(다시 묻지 않음 확인란 선택 또는 선택 취소)"
|
||||
}
|
@ -27,5 +27,11 @@
|
||||
"electron_translate_24": "NEE BEDANKT",
|
||||
"electron_translate_25": "Java is niet geïnstalleerd.",
|
||||
"electron_translate_26": "Qortal UI heeft gedetecteerd dat java niet op uw systeem is geïnstalleerd.",
|
||||
"electron_translate_27": "Klik op DOWNLOAD JAVA om java te downloaden en te installeren of op NO BEDANKT om het niet te downloaden en te installeren."
|
||||
"electron_translate_27": "Klik op DOWNLOAD JAVA om java te downloaden en te installeren of op NO BEDANKT om het niet te downloaden en te installeren.",
|
||||
"electron_translate_28": "Vraag het me nooit meer",
|
||||
"electron_translate_29": "INSTELLING WIJZIGEN",
|
||||
"electron_translate_30": "ANNULEREN",
|
||||
"electron_translate_31": "Kerninstellingen starten",
|
||||
"electron_translate_32": "Wijzig de huidige status van vragen om de kern te starten als deze niet draait",
|
||||
"electron_translate_33": "(vink het selectievakje Nooit meer vragen aan of uit)"
|
||||
}
|
37
locales/no.json
Normal file
37
locales/no.json
Normal file
@ -0,0 +1,37 @@
|
||||
{
|
||||
"__locale_name__": "Norwegian",
|
||||
|
||||
"electron_translate_1": "Vis Qortal UI",
|
||||
"electron_translate_2": "Avslutt",
|
||||
"electron_translate_3": "Oppdatering er tilgjengelig",
|
||||
"electron_translate_4": "En ny versjon av Qortal UI er tilgjengelig. Ønsker du å laste den ned?",
|
||||
"electron_translate_5": "INSTALLER NÅ",
|
||||
"electron_translate_6": "KANSKJE SENERE",
|
||||
"electron_translate_7": "Oppdateringen er klar for installering",
|
||||
"electron_translate_8": "En ny versjon av Qortal UI er lastet ned.",
|
||||
"electron_translate_9": "Klikk INSTALLER NÅ for å installere oppdateringen, eller KANSKJE SENERE for å ikke oppdatere brukergrensesnittet.",
|
||||
"electron_translate_10": "Midlertidig oppdateringsfeil, vil prøve igjen senere",
|
||||
"electron_translate_11": "LAST NED OPPDATERING",
|
||||
"electron_translate_12": "Den vil lastes ned ⌛️ i bakgrunnen!",
|
||||
"electron_translate_13": "START QORTAL CORE",
|
||||
"electron_translate_14": "NEI TAKK",
|
||||
"electron_translate_15": "Qortal Core kjører ikke på dette systemet",
|
||||
"electron_translate_16": "Qortal UI har oppdaget at Qortal Core ikke kjører på dette systemet",
|
||||
"electron_translate_17": "Klikk START QORTAL CORE for å starte Qortal Core på dette systemet, eller klikk NEI TAKK for å hoppe over å starte på dette systemet",
|
||||
"electron_translate_18": "LAST NED QORTAL CORE",
|
||||
"electron_translate_19": "NEI TAKK",
|
||||
"electron_translate_20": "Qortal Core er ikke oppdaget",
|
||||
"electron_translate_21": "Qortal UI har oppdaget at Qortal Core ikke er installert (i standard plassering) på dette systemet.",
|
||||
"electron_translate_22": "Klikk LAST NED QORTAL CORE for å laste ned og installere Core (til standard plassering), eller klikk NEI TAKK for å hoppe over nedlasting og installering.",
|
||||
"electron_translate_23": "LAST NED JAVA",
|
||||
"electron_translate_24": "NEI TAKK",
|
||||
"electron_translate_25": "Java er ikke installert.",
|
||||
"electron_translate_26": "Qortal UI har oppdaget at Java ikke er installert på systemet ditt.",
|
||||
"electron_translate_27": "Klikk på LAST NED JAVA for å laste ned og installere Java, eller på NEI TAKK for å ikke laste ned og installere det.",
|
||||
"electron_translate_28": "Aldri spør meg igjen",
|
||||
"electron_translate_29": "ENDRE INNSTILLING",
|
||||
"electron_translate_30": "AVBRYT",
|
||||
"electron_translate_31": "Start kjerneinnstillinger",
|
||||
"electron_translate_32": "Endre gjeldende status for å spørre om å starte kjernen hvis den ikke kjører",
|
||||
"electron_translate_33": "(Merk av eller fjern merket for aldri spør meg igjen)"
|
||||
}
|
@ -27,5 +27,11 @@
|
||||
"electron_translate_24": "NÃO, OBRIGADO",
|
||||
"electron_translate_25": "Java não está instalado.",
|
||||
"electron_translate_26": "Qortal UI detectou que o java não está instalado em seu sistema.",
|
||||
"electron_translate_27": "Clique em DOWNLOAD JAVA para baixar e instalar o java ou em NÃO, OBRIGADO para não baixar e instalar."
|
||||
"electron_translate_27": "Clique em DOWNLOAD JAVA para baixar e instalar o java ou em NÃO, OBRIGADO para não baixar e instalar.",
|
||||
"electron_translate_28": "Nunca mais me pergunte",
|
||||
"electron_translate_29": "ALTERAR CONFIGURAÇÃO",
|
||||
"electron_translate_30": "CANCELAR",
|
||||
"electron_translate_31": "Iniciar configurações do núcleo",
|
||||
"electron_translate_32": "Alterar o status atual de pedir para iniciar o núcleo se não estiver em execução",
|
||||
"electron_translate_33": "(Marque ou desmarque a caixa de seleção para nunca mais me perguntar)"
|
||||
}
|
@ -27,5 +27,11 @@
|
||||
"electron_translate_24": "NÃO, OBRIGADO",
|
||||
"electron_translate_25": "Java não está instalado.",
|
||||
"electron_translate_26": "Qortal UI detectou que o java não está instalado em seu sistema.",
|
||||
"electron_translate_27": "Clique em DOWNLOAD JAVA para baixar e instalar o java ou em NÃO, OBRIGADO para não baixar e instalar."
|
||||
"electron_translate_27": "Clique em DOWNLOAD JAVA para baixar e instalar o java ou em NÃO, OBRIGADO para não baixar e instalar.",
|
||||
"electron_translate_28": "Nunca mais me pergunte",
|
||||
"electron_translate_29": "ALTERAR CONFIGURAÇÃO",
|
||||
"electron_translate_30": "CANCELAR",
|
||||
"electron_translate_31": "Iniciar configurações do núcleo",
|
||||
"electron_translate_32": "Alterar o status atual de pedir para iniciar o núcleo se não estiver em execução",
|
||||
"electron_translate_33": "(Marque ou desmarque a caixa de seleção para nunca mais me perguntar)"
|
||||
}
|
@ -27,5 +27,11 @@
|
||||
"electron_translate_24": "НЕТ, СПАСИБО",
|
||||
"electron_translate_25": "Java не установлена.",
|
||||
"electron_translate_26": "Пользовательский интерфейс Qortal обнаружил, что в вашей системе не установлена Java.",
|
||||
"electron_translate_27": "Нажмите ЗАГРУЗИТЬ JAVA, чтобы загрузить и установить Java, или НЕТ, СПАСИБО, чтобы не загружать и устанавливать его."
|
||||
"electron_translate_27": "Нажмите ЗАГРУЗИТЬ JAVA, чтобы загрузить и установить Java, или НЕТ, СПАСИБО, чтобы не загружать и устанавливать его.",
|
||||
"electron_translate_28": "Никогда больше не спрашивайте меня",
|
||||
"electron_translate_29": "ИЗМЕНИТЬ НАСТРОЙКИ",
|
||||
"electron_translate_30": "ОТМЕНИТЬ",
|
||||
"electron_translate_31": "Начать основные настройки",
|
||||
"electron_translate_32": "Изменить текущий статус запроса на запуск ядра, если оно не запущено",
|
||||
"electron_translate_33": "(Установите или снимите флажок Больше не спрашивать)"
|
||||
}
|
@ -27,5 +27,11 @@
|
||||
"electron_translate_24": "TEŞEKKÜR ETMİYORUM",
|
||||
"electron_translate_25": "Java yüklü değil.",
|
||||
"electron_translate_26": "Qortal UI sisteminizde java'nın kurulu olmadığını tespit etti.",
|
||||
"electron_translate_27": "Java'yı indirip yüklemek için JAVA'YI İNDİR'e, indirip kurmamak için HAYIR'a TEŞEKKÜRLER'e tıklayın."
|
||||
"electron_translate_27": "Java'yı indirip yüklemek için JAVA'YI İNDİR'e, indirip kurmamak için HAYIR'a TEŞEKKÜRLER'e tıklayın.",
|
||||
"electron_translate_28": "Bir daha asla sorma",
|
||||
"electron_translate_29": "AYARI DEĞİŞTİR",
|
||||
"electron_translate_30": "İPTAL",
|
||||
"electron_translate_31": "Temel Ayarları Başlat",
|
||||
"electron_translate_32": "Çalışmıyorsa çekirdeği başlatma isteğinin mevcut durumunu değiştir",
|
||||
"electron_translate_33": "(Bana bir daha asla sorma onay kutusunu işaretleyin veya işaretini kaldırın)"
|
||||
}
|
@ -27,5 +27,12 @@
|
||||
"electron_translate_24": "NO THANKS",
|
||||
"electron_translate_25": "Java is not installed.",
|
||||
"electron_translate_26": "Qortal UI has detected that java is not installed on your system.",
|
||||
"electron_translate_27": "Click on DOWNLOAD JAVA to download and install java or on NO THANKS to not download and install it."
|
||||
"electron_translate_27": "Click on DOWNLOAD JAVA to download and install java or on NO THANKS to not download and install it.",
|
||||
"electron_translate_28": "Never ask me again",
|
||||
"electron_translate_29": "CHANGE SETTING",
|
||||
"electron_translate_30": "CANCEL",
|
||||
"electron_translate_31": "Start Core Setiings",
|
||||
"electron_translate_32": "Change the current status of asking to start the core if it is not running",
|
||||
"electron_translate_33": "(Check or Uncheck the never ask me again checkbox)",
|
||||
"electron_translate_34": "Settings"
|
||||
}
|
@ -27,5 +27,11 @@
|
||||
"electron_translate_24": "不用谢",
|
||||
"electron_translate_25": "Java 未安装。",
|
||||
"electron_translate_26": "Qortal UI 检测到您的系统上没有安装 java。",
|
||||
"electron_translate_27": "点击 DOWNLOAD JAVA 下载并安装 java 或点击 NO THANKS 不下载并安装它。"
|
||||
"electron_translate_27": "点击 DOWNLOAD JAVA 下载并安装 java 或点击 NO THANKS 不下载并安装它。",
|
||||
"electron_translate_28": "不要再问我",
|
||||
"electron_translate_29": "更改设置",
|
||||
"electron_translate_30": "取消",
|
||||
"electron_translate_31": "开始核心设置",
|
||||
"electron_translate_32": "更改核心未运行时要求启动的当前状态",
|
||||
"electron_translate_33": "(选中或取消选中不再询问复选框)"
|
||||
}
|
@ -27,5 +27,11 @@
|
||||
"electron_translate_24": "不用謝",
|
||||
"electron_translate_25": "Java 未安裝。",
|
||||
"electron_translate_26": "Qortal UI 檢測到您的系統上沒有安裝 java。",
|
||||
"electron_translate_27": "點擊 DOWNLOAD JAVA 下載並安裝 java 或點擊 NO THANKS 不下載並安裝它。"
|
||||
"electron_translate_27": "點擊 DOWNLOAD JAVA 下載並安裝 java 或點擊 NO THANKS 不下載並安裝它。",
|
||||
"electron_translate_28": "不要再問我",
|
||||
"electron_translate_29": "更改設置",
|
||||
"electron_translate_30": "取消",
|
||||
"electron_translate_31": "開始核心設置",
|
||||
"electron_translate_32": "更改核心未運行時要求啟動的當前狀態",
|
||||
"electron_translate_33": "(勾選或取消勾選不再詢問複選框)"
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "qortal-ui",
|
||||
"version": "4.0.0",
|
||||
"version": "4.0.3",
|
||||
"description": "Qortal Project - decentralize the world - Data storage, communications, web hosting, decentralized trading, complete infrastructure for the future blockchain-based Internet",
|
||||
"keywords": [
|
||||
"QORT",
|
||||
@ -35,12 +35,13 @@
|
||||
"electron-log": "4.4.8",
|
||||
"electron-updater": "5.3.0",
|
||||
"electron-dl": "3.5.0",
|
||||
"electron-store": "8.1.0",
|
||||
"extract-zip": "2.0.1",
|
||||
"node-fetch": "2.6.9",
|
||||
"os-locale": "3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"electron": "24.1.2",
|
||||
"electron": "24.1.3",
|
||||
"electron-builder": "23.6.0",
|
||||
"electron-packager": "17.1.1",
|
||||
"shelljs": "0.8.5"
|
||||
|
@ -135,7 +135,8 @@
|
||||
"exp1": "Privaten Hauptschlüssel exportieren",
|
||||
"exp2": "Hauptschlüssel exportieren",
|
||||
"exp3": "Exportieren",
|
||||
"exp4": "Bitte wählen Sie eine Brieftasche aus, um den privaten Hauptschlüssel zu sichern."
|
||||
"exp4": "Bitte wählen Sie eine Brieftasche aus, um den privaten Hauptschlüssel zu sichern.",
|
||||
"core": "Core-Einstellungen starten"
|
||||
},
|
||||
"appinfo": {
|
||||
"blockheight": "Blockhöhe",
|
||||
|
@ -135,7 +135,8 @@
|
||||
"exp1": "Exportar clave maestra privada",
|
||||
"exp2": "Exportar clave maestra",
|
||||
"exp3": "Exportar",
|
||||
"exp4": "Elija una billetera para hacer una copia de seguridad de la clave maestra privada."
|
||||
"exp4": "Elija una billetera para hacer una copia de seguridad de la clave maestra privada.",
|
||||
"core": "Iniciar configuración básica"
|
||||
},
|
||||
"appinfo": {
|
||||
"blockheight": "Altura del Bloque",
|
||||
|
@ -135,7 +135,8 @@
|
||||
"exp1": "Exporter la clé principale privée",
|
||||
"exp2": "Exporter la clé principale",
|
||||
"exp3": "Exporter",
|
||||
"exp4": "Veuillez choisir un portefeuille pour sauvegarder la clé principale privée."
|
||||
"exp4": "Veuillez choisir un portefeuille pour sauvegarder la clé principale privée.",
|
||||
"core": "Démarrer les paramètres du noyau"
|
||||
},
|
||||
"appinfo": {
|
||||
"blockheight": "Hauteur de bloc",
|
||||
|
@ -136,7 +136,8 @@
|
||||
"exp1": "निजी मास्टर कुंजी निर्यात करें",
|
||||
"exp2": "निर्यात मास्टर कुंजी",
|
||||
"exp3": "निर्यात",
|
||||
"exp4": "निजी मास्टर कुंजी का बैकअप लेने के लिए कृपया एक वॉलेट चुनें।"
|
||||
"exp4": "निजी मास्टर कुंजी का बैकअप लेने के लिए कृपया एक वॉलेट चुनें।",
|
||||
"core": "कोर सेटिंग प्रारंभ करें"
|
||||
},
|
||||
"appinfo": {
|
||||
"blockheight": "ब्लॉक ऊँचाई",
|
||||
|
@ -135,7 +135,8 @@
|
||||
"exp1": "Izvezi privatni glavni ključ",
|
||||
"exp2": "Glavni ključ izvoza",
|
||||
"exp3": "Izvoz",
|
||||
"exp4": "Odaberite novčanik za sigurnosnu kopiju privatnog glavnog ključa."
|
||||
"exp4": "Odaberite novčanik za sigurnosnu kopiju privatnog glavnog ključa.",
|
||||
"core": "Pokreni osnovne postavke"
|
||||
},
|
||||
"appinfo": {
|
||||
"blockheight": "Visina bloka",
|
||||
|
@ -135,7 +135,8 @@
|
||||
"exp1": "Privát főkulcs exportálása",
|
||||
"exp2": "Főkulcs exportálása",
|
||||
"exp3": "Exportálás",
|
||||
"exp4": "Kérjük, válasszon egy tárcát a privát főkulcs biztonsági mentéséhez."
|
||||
"exp4": "Kérjük, válasszon egy tárcát a privát főkulcs biztonsági mentéséhez.",
|
||||
"core": "Alapbeállítások indítása"
|
||||
},
|
||||
"appinfo": {
|
||||
"blockheight": "Blokk Magassága",
|
||||
|
@ -135,7 +135,8 @@
|
||||
"exp1": "Esporta chiave master privata",
|
||||
"exp2": "Esporta chiave master",
|
||||
"exp3": "Esporta",
|
||||
"exp4": "Scegli un portafoglio per il backup della chiave master privata."
|
||||
"exp4": "Scegli un portafoglio per il backup della chiave master privata.",
|
||||
"core": "Avvia impostazioni principali"
|
||||
},
|
||||
"appinfo": {
|
||||
"blockheight": "Altezza blocco",
|
||||
|
@ -135,7 +135,8 @@
|
||||
"exp1": "개인 마스터 키 내보내기",
|
||||
"exp2": "마스터 키 내보내기",
|
||||
"exp3": "내보내기",
|
||||
"exp4": "개인 마스터 키를 백업할 지갑을 선택하세요."
|
||||
"exp4": "개인 마스터 키를 백업할 지갑을 선택하세요.",
|
||||
"core": "코어 설정 시작"
|
||||
},
|
||||
"appinfo": {
|
||||
"blockheight": "블록 높이",
|
||||
|
@ -135,7 +135,8 @@
|
||||
"exp1": "Eksporter privat hovednøkkel",
|
||||
"exp2": "Eksporter hovednøkkel",
|
||||
"exp3": "Eksporter",
|
||||
"exp4": "Velg en lommebok for å sikkerhetskopiere den private hovednøkkelen."
|
||||
"exp4": "Velg en lommebok for å sikkerhetskopiere den private hovednøkkelen.",
|
||||
"core": "Start kjerneinnstillinger"
|
||||
},
|
||||
"appinfo": {
|
||||
"blockheight": "Blokkhøyde",
|
||||
|
@ -135,7 +135,8 @@
|
||||
"exp1": "Eksportuj prywatny klucz główny",
|
||||
"exp2": "Eksportuj klucz główny",
|
||||
"exp3": "Eksportuj",
|
||||
"exp4": "Wybierz portfel do wykonania kopii zapasowej prywatnego klucza głównego."
|
||||
"exp4": "Wybierz portfel do wykonania kopii zapasowej prywatnego klucza głównego.",
|
||||
"core": "Uruchom podstawowe ustawienia"
|
||||
},
|
||||
"appinfo": {
|
||||
"blockheight": "Wysokość bloku",
|
||||
|
@ -135,7 +135,8 @@
|
||||
"exp1": "Exportar Chave Mestra Privada",
|
||||
"exp2": "Exportar Chave Mestra",
|
||||
"exp3": "Exportar",
|
||||
"exp4": "Por favor, escolha uma carteira para fazer backup da chave mestra privada."
|
||||
"exp4": "Por favor, escolha uma carteira para fazer backup da chave mestra privada.",
|
||||
"core": "Iniciar configurações do núcleo"
|
||||
},
|
||||
"appinfo": {
|
||||
"blockheight": "Altura do Bloco",
|
||||
|
@ -135,7 +135,8 @@
|
||||
"exp1": "Exportați cheia principală privată",
|
||||
"exp2": "Exportați cheia principală",
|
||||
"exp3": "Export",
|
||||
"exp4": "Vă rugăm să alegeți un portofel pentru a face backup cheii master private."
|
||||
"exp4": "Vă rugăm să alegeți un portofel pentru a face backup cheii master private.",
|
||||
"core": "Porniți setările de bază"
|
||||
},
|
||||
"appinfo": {
|
||||
"blockheight": "Dimensiunea blocului",
|
||||
|
@ -135,7 +135,8 @@
|
||||
"exp1": "Izvezi privatni glavni ključ",
|
||||
"exp2": "Izvezi glavni ključ",
|
||||
"exp3": "Izvoz",
|
||||
"exp4": "Molimo izaberite novčanik za rezervnu kopiju privatnog glavnog ključa."
|
||||
"exp4": "Molimo izaberite novčanik za rezervnu kopiju privatnog glavnog ključa.",
|
||||
"core": "Pokreni podešavanja jezgra"
|
||||
},
|
||||
"appinfo": {
|
||||
"blockheight": "Visina Bloka",
|
||||
|
@ -135,7 +135,8 @@
|
||||
"exp1": "Экспорт закрытого мастер-ключа",
|
||||
"exp2": "Экспорт мастер-ключа",
|
||||
"exp3": "Экспорт",
|
||||
"exp4": "Пожалуйста, выберите кошелек для резервного копирования приватного главного ключа."
|
||||
"exp4": "Пожалуйста, выберите кошелек для резервного копирования приватного главного ключа.",
|
||||
"core": "Начать основные настройки"
|
||||
},
|
||||
"appinfo": {
|
||||
"blockheight": "Высота блока",
|
||||
|
@ -135,7 +135,8 @@
|
||||
"exp1": "Export Private Master Key",
|
||||
"exp2": "Export Master Key",
|
||||
"exp3": "Export",
|
||||
"exp4": "Please choose a wallet to backup the private master key."
|
||||
"exp4": "Please choose a wallet to backup the private master key.",
|
||||
"core": "Start Core Setiings"
|
||||
},
|
||||
"appinfo": {
|
||||
"blockheight": "Block Height",
|
||||
|
@ -135,7 +135,8 @@
|
||||
"exp1": "导出主密钥",
|
||||
"exp2": "导出主密钥",
|
||||
"exp3": "导出",
|
||||
"exp4": "请选择一个钱包来备份私钥。"
|
||||
"exp4": "请选择一个钱包来备份私钥。",
|
||||
"core": "开始核心设置"
|
||||
},
|
||||
"appinfo": {
|
||||
"blockheight": "区块高度",
|
||||
|
@ -135,7 +135,8 @@
|
||||
"exp1": "導出主密鑰",
|
||||
"exp2": "導出主密鑰",
|
||||
"exp3": "導出",
|
||||
"exp4": "請選擇一個錢包來備份私鑰。"
|
||||
"exp4": "請選擇一個錢包來備份私鑰。",
|
||||
"core": "開始核心設置"
|
||||
},
|
||||
"appinfo": {
|
||||
"blockheight": "區塊高度",
|
||||
|
@ -17,12 +17,12 @@
|
||||
"author": "QORTAL <admin@qortal.org>",
|
||||
"license": "GPL-3.0",
|
||||
"dependencies": {
|
||||
"@hapi/hapi": "21.3.1",
|
||||
"@hapi/hapi": "21.3.2",
|
||||
"@hapi/inert": "7.1.0",
|
||||
"sass": "1.62.0"
|
||||
"sass": "1.62.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "7.21.4",
|
||||
"@babel/core": "7.21.5",
|
||||
"@material/mwc-button": "0.27.0",
|
||||
"@material/mwc-checkbox": "0.27.0",
|
||||
"@material/mwc-dialog": "0.27.0",
|
||||
@ -60,22 +60,21 @@
|
||||
"@rollup/plugin-node-resolve": "15.0.2",
|
||||
"@rollup/plugin-replace": "5.0.2",
|
||||
"@rollup/plugin-terser": "0.4.1",
|
||||
"@vaadin/button": "24.0.3",
|
||||
"@vaadin/grid": "24.0.3",
|
||||
"@vaadin/icons": "24.0.3",
|
||||
"@vaadin/password-field": "24.0.3",
|
||||
"@vaadin/tooltip": "24.0.3",
|
||||
"@vaadin/button": "24.0.4",
|
||||
"@vaadin/grid": "24.0.4",
|
||||
"@vaadin/icons": "24.0.4",
|
||||
"@vaadin/password-field": "24.0.4",
|
||||
"@vaadin/tooltip": "24.0.4",
|
||||
"asmcrypto.js": "2.3.2",
|
||||
"bcryptjs": "2.4.3",
|
||||
"epml": "0.3.3",
|
||||
"file-saver": "2.0.5",
|
||||
"lit": "2.7.2",
|
||||
"lit": "2.7.3",
|
||||
"lit-translate": "2.0.1",
|
||||
"localforage": "1.10.0",
|
||||
"pwa-helpers": "0.9.1",
|
||||
"redux": "4.2.1",
|
||||
"redux-thunk": "2.4.2",
|
||||
"rollup": "3.20.7",
|
||||
"rollup": "3.21.1",
|
||||
"rollup-plugin-node-globals": "1.4.0",
|
||||
"rollup-plugin-progress": "1.1.2",
|
||||
"rollup-plugin-scss": "3.0.0"
|
||||
|
@ -28,6 +28,7 @@ import './qort-theme-toggle.js'
|
||||
import './language-selector.js'
|
||||
import './settings-view/user-settings.js'
|
||||
import './logout-view/logout-view.js'
|
||||
import './check-for-update.js'
|
||||
import './user-info-view/user-info-view.js'
|
||||
import '../functional-components/side-menu.js'
|
||||
import '../functional-components/side-menu-item.js'
|
||||
@ -502,6 +503,8 @@ class AppView extends connect(store)(LitElement) {
|
||||
<paper-icon-button icon="icons:settings" @click=${() => this.openSettings()} title="${translate("settings.settings")}"></paper-icon-button>
|
||||
</div>
|
||||
<div> </div>
|
||||
<check-for-update></check-for-update>
|
||||
<div> </div>
|
||||
<div style="display: inline;">
|
||||
<paper-icon-button icon="icons:exit-to-app" @click=${() => this.openLogout()} title="${translate("logout.logout")}"></paper-icon-button>
|
||||
</div>
|
||||
|
41
qortal-ui-core/src/components/check-for-update.js
Normal file
41
qortal-ui-core/src/components/check-for-update.js
Normal file
@ -0,0 +1,41 @@
|
||||
import { LitElement, html, css } from 'lit'
|
||||
import { get, translate, translateUnsafeHTML } from 'lit-translate'
|
||||
|
||||
import '@polymer/paper-icon-button/paper-icon-button.js'
|
||||
import '@polymer/iron-icons/iron-icons.js'
|
||||
|
||||
class CheckForUpdate extends LitElement {
|
||||
static get properties() {
|
||||
return {
|
||||
theme: { type: String, reflect: true }
|
||||
}
|
||||
}
|
||||
|
||||
constructor() {
|
||||
super()
|
||||
this.theme = localStorage.getItem('qortalTheme') ? localStorage.getItem('qortalTheme') : 'light'
|
||||
}
|
||||
|
||||
static styles = [
|
||||
css`
|
||||
`
|
||||
]
|
||||
|
||||
render() {
|
||||
return html`
|
||||
<div style="display: inline;">
|
||||
<paper-icon-button icon="icons:get-app" @click=${() => this.checkupdate()} title="${translate("appspage.schange38")} UI"></paper-icon-button>
|
||||
</div>
|
||||
`
|
||||
}
|
||||
|
||||
firstUpdated() {
|
||||
}
|
||||
|
||||
|
||||
checkupdate() {
|
||||
window.electronAPI.checkForUpdate()
|
||||
}
|
||||
}
|
||||
|
||||
window.customElements.define('check-for-update', CheckForUpdate)
|
@ -7,7 +7,6 @@ import { createWallet } from '../../../../qortal-ui-crypto/api/createWallet.js'
|
||||
import { doLogin, doLogout, doSelectAddress } from '../../redux/app/app-actions.js'
|
||||
import { doStoreWallet } from '../../redux/user/user-actions.js'
|
||||
import { checkApiKey } from '../../apiKeyUtils.js'
|
||||
import FileSaver from 'file-saver'
|
||||
import ripple from '../../functional-components/loading-ripple.js'
|
||||
import snackbar from '../../functional-components/snackbar.js'
|
||||
import '../../functional-components/random-sentence-generator.js'
|
||||
@ -587,17 +586,45 @@ class CreateAccountSection extends connect(store)(LitElement) {
|
||||
}
|
||||
|
||||
async downloadBackup(wallet) {
|
||||
let backupname = ""
|
||||
const state = store.getState()
|
||||
const data = await wallet.generateSaveWalletData(this._pass, state.config.crypto.kdfThreads, () => { })
|
||||
const dataString = JSON.stringify(data)
|
||||
const blob = new Blob([dataString], { type: 'text/plain;charset=utf-8' })
|
||||
FileSaver.saveAs(blob, `qortal_backup_${wallet.addresses[0].address}.json`)
|
||||
backupname = "qortal_backup_" + wallet.addresses[0].address + ".json"
|
||||
this.saveFileToDisk(blob, backupname)
|
||||
}
|
||||
|
||||
downloadSeedphrase() {
|
||||
let seedname = ""
|
||||
const seed = this.shadowRoot.getElementById('randSentence').parsedString
|
||||
const blob = new Blob([seed], { type: 'text/plain;charset=utf-8' })
|
||||
FileSaver.saveAs(blob, `qortal_seedphrase.txt`)
|
||||
seedname = "qortal_seedphrase_" + wallet.addresses[0].address + ".txt"
|
||||
this.saveFileToDisk(blob, seedname)
|
||||
}
|
||||
|
||||
async saveFileToDisk(blob, fileName) {
|
||||
try {
|
||||
const fileHandle = await self.showSaveFilePicker({
|
||||
suggestedName: fileName,
|
||||
types: [{
|
||||
description: "File",
|
||||
}]
|
||||
})
|
||||
const writeFile = async (fileHandle, contents) => {
|
||||
const writable = await fileHandle.createWritable()
|
||||
await writable.write(contents)
|
||||
await writable.close()
|
||||
}
|
||||
writeFile(fileHandle, blob).then(() => console.log("FILE SAVED"))
|
||||
let snack4string = get("general.save")
|
||||
snackbar.add({
|
||||
labelText: `${snack4string} ${fileName} ✅`,
|
||||
dismiss: true
|
||||
})
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,11 +2,11 @@ import { LitElement, html, css } from 'lit'
|
||||
import { connect } from 'pwa-helpers'
|
||||
import { store } from '../../store.js'
|
||||
import { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from 'lit-translate'
|
||||
import snackbar from '../../functional-components/snackbar.js'
|
||||
|
||||
import '@material/mwc-dialog'
|
||||
import '@material/mwc-button'
|
||||
import '@material/mwc-icon'
|
||||
import FileSaver from 'file-saver'
|
||||
|
||||
class ExportKeys extends connect(store)(LitElement) {
|
||||
static get properties() {
|
||||
@ -222,11 +222,37 @@ class ExportKeys extends connect(store)(LitElement) {
|
||||
}
|
||||
|
||||
async exportKey(cMasterKey, cName, cAddress) {
|
||||
let exportname = ""
|
||||
const myPrivateMasterKey = cMasterKey
|
||||
const myCoinName = cName
|
||||
const myCoinAddress = cAddress
|
||||
const blob = new Blob([`${myPrivateMasterKey}`], { type: 'text/plain;charset=utf-8' })
|
||||
FileSaver.saveAs(blob, `Private_Master_Key_${myCoinName}_${myCoinAddress}.txt`)
|
||||
exportname = "Private_Master_Key_" + myCoinName + "_" + myCoinAddress + ".txt"
|
||||
this.saveFileToDisk(blob, exportname)
|
||||
}
|
||||
|
||||
async saveFileToDisk(blob, fileName) {
|
||||
try {
|
||||
const fileHandle = await self.showSaveFilePicker({
|
||||
suggestedName: fileName,
|
||||
types: [{
|
||||
description: "File",
|
||||
}]
|
||||
})
|
||||
const writeFile = async (fileHandle, contents) => {
|
||||
const writable = await fileHandle.createWritable()
|
||||
await writable.write(contents)
|
||||
await writable.close()
|
||||
}
|
||||
writeFile(fileHandle, blob).then(() => console.log("FILE SAVED"))
|
||||
let snack4string = get("general.save")
|
||||
snackbar.add({
|
||||
labelText: `${snack4string} ${fileName} ✅`,
|
||||
dismiss: true
|
||||
})
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
stateChanged(state) {
|
||||
|
@ -83,6 +83,28 @@ class NotificationsView extends connect(store)(LitElement) {
|
||||
font-size: 16px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.q-button {
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-content: center;
|
||||
border: none;
|
||||
border-radius: 20px;
|
||||
padding-left: 25px;
|
||||
padding-right: 25px;
|
||||
color: white;
|
||||
background: #03a9f4;
|
||||
width: 50%;
|
||||
font-size: 17px;
|
||||
cursor: pointer;
|
||||
height: 50px;
|
||||
margin-top: 1rem;
|
||||
text-transform: uppercase;
|
||||
text-decoration: none;
|
||||
transition: all .2s;
|
||||
position: relative;
|
||||
}
|
||||
`
|
||||
}
|
||||
|
||||
@ -123,10 +145,17 @@ class NotificationsView extends connect(store)(LitElement) {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="max-width: 500px; display: flex; justify-content: center; margin: auto;">
|
||||
<div @click=${() => this.checkCoreSettings()} class="q-button"> ${translate("settings.core")} </div>
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
}
|
||||
|
||||
checkCoreSettings() {
|
||||
window.electronAPI.setStartCore()
|
||||
}
|
||||
|
||||
stateChanged(state) {
|
||||
this.notificationConfig = state.user.notifications
|
||||
this.q_chatConfig = this.notificationConfig.q_chat
|
||||
|
@ -3,12 +3,12 @@ import { connect } from 'pwa-helpers'
|
||||
import { store } from '../../store.js'
|
||||
import { allowQAPPAutoAuth, removeQAPPAutoAuth, removeQAPPAutoLists, allowQAPPAutoLists } from '../../redux/app/app-actions.js'
|
||||
import { use, get, translate, translateUnsafeHTML, registerTranslateConfig } from 'lit-translate'
|
||||
import snackbar from '../../functional-components/snackbar.js'
|
||||
|
||||
import '@material/mwc-checkbox'
|
||||
import '@material/mwc-textfield'
|
||||
import '@material/mwc-icon'
|
||||
import '@vaadin/password-field/vaadin-password-field.js'
|
||||
import FileSaver from 'file-saver'
|
||||
|
||||
class SecurityView extends connect(store)(LitElement) {
|
||||
static get properties() {
|
||||
@ -155,13 +155,39 @@ class SecurityView extends connect(store)(LitElement) {
|
||||
}
|
||||
|
||||
async downloadBackup() {
|
||||
let backupname = ''
|
||||
this.backupErrorMessage = ''
|
||||
const state = store.getState()
|
||||
const password = this.shadowRoot.getElementById('downloadBackupPassword').value
|
||||
const data = await state.app.wallet.generateSaveWalletData(password, state.config.crypto.kdfThreads, () => { })
|
||||
const dataString = JSON.stringify(data)
|
||||
const blob = new Blob([dataString], { type: 'text/plain;charset=utf-8' })
|
||||
FileSaver.saveAs(blob, `qortal_backup_${state.app.selectedAddress.address}.json`)
|
||||
backupname = "qortal_backup_" + state.app.selectedAddress.address + ".json"
|
||||
this.saveFileToDisk(blob, backupname)
|
||||
}
|
||||
|
||||
async saveFileToDisk(blob, fileName) {
|
||||
try {
|
||||
const fileHandle = await self.showSaveFilePicker({
|
||||
suggestedName: fileName,
|
||||
types: [{
|
||||
description: "File",
|
||||
}]
|
||||
})
|
||||
const writeFile = async (fileHandle, contents) => {
|
||||
const writable = await fileHandle.createWritable()
|
||||
await writable.write(contents)
|
||||
await writable.close()
|
||||
}
|
||||
writeFile(fileHandle, blob).then(() => console.log("FILE SAVED"))
|
||||
let snack4string = get("general.save")
|
||||
snackbar.add({
|
||||
labelText: `${snack4string} ${fileName} ✅`,
|
||||
dismiss: true
|
||||
})
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -124,10 +124,14 @@ class WalletProfile extends connect(store)(LitElement) {
|
||||
}
|
||||
|
||||
getAvatar() {
|
||||
const avatarNode = store.getState().app.nodeConfig.knownNodes[store.getState().app.nodeConfig.node]
|
||||
const avatarUrl = avatarNode.protocol + '://' + avatarNode.domain + ':' + avatarNode.port
|
||||
const url = `${avatarUrl}/arbitrary/THUMBNAIL/${this.accountInfo.names[0].name}/qortal_avatar?async=true&apiKey=${this.getApiKey()}`
|
||||
return html`<img class="round-fullinfo" src="${url}" onerror="this.src='/img/incognito.png';" />`
|
||||
if (this.accountInfo.names.length === 0) {
|
||||
return html`<img class="round-fullinfo" src="/img/incognito.png">`
|
||||
} else {
|
||||
const avatarNode = store.getState().app.nodeConfig.knownNodes[store.getState().app.nodeConfig.node]
|
||||
const avatarUrl = avatarNode.protocol + '://' + avatarNode.domain + ':' + avatarNode.port
|
||||
const url = `${avatarUrl}/arbitrary/THUMBNAIL/${this.accountInfo.names[0].name}/qortal_avatar?async=true&apiKey=${this.getApiKey()}`
|
||||
return html`<img class="round-fullinfo" src="${url}" onerror="this.src='/img/incognito.png';" />`
|
||||
}
|
||||
}
|
||||
|
||||
getApiKey() {
|
||||
|
@ -3,7 +3,6 @@ import { connect } from 'pwa-helpers'
|
||||
import { store } from '../store.js'
|
||||
import { doAddNode, doSetNode, doLoadNodeConfig } from '../redux/app/app-actions.js'
|
||||
import { get, translate, translateUnsafeHTML } from 'lit-translate'
|
||||
import FileSaver from 'file-saver'
|
||||
import snackbar from './snackbar.js'
|
||||
import '../components/language-selector.js'
|
||||
import '../custom-elements/frag-file-input.js'
|
||||
@ -320,16 +319,36 @@ class SettingsPage extends connect(store)(LitElement) {
|
||||
}
|
||||
|
||||
exportQortalNodesList() {
|
||||
let nodelist = ""
|
||||
const qortalNodesList = JSON.stringify(localStorage.getItem("myQortalNodes"))
|
||||
const qortalNodesListSave = JSON.parse((qortalNodesList) || "[]")
|
||||
const blob = new Blob([qortalNodesListSave], { type: 'text/plain;charset=utf-8' })
|
||||
FileSaver.saveAs(blob, `qortal.nodes`)
|
||||
nodelist = "qortal.nodes"
|
||||
this.saveFileToDisk(blob, nodelist)
|
||||
}
|
||||
|
||||
let snack4string = get("settings.snack4")
|
||||
snackbar.add({
|
||||
labelText: `${snack4string} qortal.nodes`,
|
||||
dismiss: true
|
||||
})
|
||||
async saveFileToDisk(blob, fileName) {
|
||||
try {
|
||||
const fileHandle = await self.showSaveFilePicker({
|
||||
suggestedName: fileName,
|
||||
types: [{
|
||||
description: "File",
|
||||
}]
|
||||
})
|
||||
const writeFile = async (fileHandle, contents) => {
|
||||
const writable = await fileHandle.createWritable()
|
||||
await writable.write(contents)
|
||||
await writable.close()
|
||||
}
|
||||
writeFile(fileHandle, blob).then(() => console.log("FILE SAVED"))
|
||||
let snack4string = get("settings.snack4")
|
||||
snackbar.add({
|
||||
labelText: `${snack4string} qortal.nodes`,
|
||||
dismiss: true
|
||||
})
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
renderImportNodesListButton() {
|
||||
|
@ -1,16 +1,19 @@
|
||||
import { Sha256 } from 'asmcrypto.js'
|
||||
import Base58 from './api/deps/Base58'
|
||||
import Base64 from './api/deps/Base64'
|
||||
import { base58PublicKeyToAddress } from './api/wallet/base58PublicKeyToAddress'
|
||||
import { validateAddress } from './api/wallet/validateAddress'
|
||||
import { decryptChatMessage } from './api/transactions/chat/decryptChatMessage'
|
||||
import { decryptChatMessage, decryptChatMessageBase64 } from './api/transactions/chat/decryptChatMessage'
|
||||
import _ from 'lodash'
|
||||
|
||||
window.Sha256 = Sha256
|
||||
window.Base58 = Base58
|
||||
window.Base64 = Base64
|
||||
window._ = _
|
||||
window.base58PublicKeyToAddress = base58PublicKeyToAddress
|
||||
window.validateAddress = validateAddress
|
||||
window.decryptChatMessage = decryptChatMessage
|
||||
window.decryptChatMessageBase64 = decryptChatMessageBase64
|
||||
|
||||
export { initApi, store } from './api_deps.js'
|
||||
export * from './api/deps/deps.js'
|
||||
|
24
qortal-ui-crypto/api/deps/Base64.js
Normal file
24
qortal-ui-crypto/api/deps/Base64.js
Normal file
@ -0,0 +1,24 @@
|
||||
|
||||
const Base64 = {};
|
||||
|
||||
|
||||
|
||||
Base64.decode = function (string) {
|
||||
|
||||
const binaryString = atob(string);
|
||||
const binaryLength = binaryString.length;
|
||||
const bytes = new Uint8Array(binaryLength);
|
||||
|
||||
for (let i = 0; i < binaryLength; i++) {
|
||||
bytes[i] = binaryString.charCodeAt(i);
|
||||
}
|
||||
|
||||
const decoder = new TextDecoder();
|
||||
const decodedString = decoder.decode(bytes);
|
||||
return decodedString;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
export default Base64;
|
@ -24,3 +24,34 @@ export const decryptChatMessage = (encryptedMessage, privateKey, recipientPublic
|
||||
_decryptedMessage === false ? decryptedMessage : decryptedMessage = new TextDecoder('utf-8').decode(_decryptedMessage)
|
||||
return decryptedMessage
|
||||
}
|
||||
|
||||
export const decryptChatMessageBase64 = (encryptedMessage, privateKey, recipientPublicKey, lastReference) => {
|
||||
let _encryptedMessage = atob(encryptedMessage);
|
||||
const binaryLength = _encryptedMessage.length;
|
||||
const bytes = new Uint8Array(binaryLength);
|
||||
|
||||
for (let i = 0; i < binaryLength; i++) {
|
||||
bytes[i] = _encryptedMessage.charCodeAt(i);
|
||||
}
|
||||
|
||||
const _base58RecipientPublicKey = recipientPublicKey instanceof Uint8Array ? Base58.encode(recipientPublicKey) : recipientPublicKey
|
||||
const _recipientPublicKey = Base58.decode(_base58RecipientPublicKey)
|
||||
|
||||
const _lastReference = lastReference instanceof Uint8Array ? lastReference : Base58.decode(lastReference)
|
||||
|
||||
const convertedPrivateKey = ed2curve.convertSecretKey(privateKey)
|
||||
const convertedPublicKey = ed2curve.convertPublicKey(_recipientPublicKey)
|
||||
const sharedSecret = new Uint8Array(32);
|
||||
nacl.lowlevel.crypto_scalarmult(sharedSecret, convertedPrivateKey, convertedPublicKey)
|
||||
|
||||
const _chatEncryptionSeed = new Sha256().process(sharedSecret).finish().result
|
||||
const _decryptedMessage = nacl.secretbox.open(bytes, _lastReference.slice(0, 24), _chatEncryptionSeed)
|
||||
|
||||
|
||||
if (_decryptedMessage === false) {
|
||||
return _decryptedMessage
|
||||
}
|
||||
return new TextDecoder('utf-8').decode(_decryptedMessage)
|
||||
|
||||
|
||||
}
|
@ -41,11 +41,11 @@
|
||||
"prosemirror-schema-list": "1.2.2",
|
||||
"prosemirror-state": "1.4.2",
|
||||
"prosemirror-transform": "1.7.1",
|
||||
"prosemirror-view": "1.30.2",
|
||||
"prosemirror-view": "1.31.0",
|
||||
"short-unique-id": "4.4.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "7.21.4",
|
||||
"@babel/core": "7.21.5",
|
||||
"@material/mwc-button": "0.27.0",
|
||||
"@material/mwc-checkbox": "0.27.0",
|
||||
"@material/mwc-dialog": "0.27.0",
|
||||
@ -72,21 +72,20 @@
|
||||
"@rollup/plugin-node-resolve": "15.0.2",
|
||||
"@rollup/plugin-replace": "5.0.2",
|
||||
"@rollup/plugin-terser": "0.4.1",
|
||||
"@vaadin/avatar": "24.0.3",
|
||||
"@vaadin/button": "24.0.3",
|
||||
"@vaadin/grid": "24.0.3",
|
||||
"@vaadin/icons": "24.0.3",
|
||||
"@vaadin/tooltip": "24.0.3",
|
||||
"@vaadin/avatar": "24.0.4",
|
||||
"@vaadin/button": "24.0.4",
|
||||
"@vaadin/grid": "24.0.4",
|
||||
"@vaadin/icons": "24.0.4",
|
||||
"@vaadin/tooltip": "24.0.4",
|
||||
"@zip.js/zip.js": "2.7.6",
|
||||
"axios": "1.3.5",
|
||||
"epml": "0.3.3",
|
||||
"file-saver": "2.0.5",
|
||||
"highcharts": "10.3.3",
|
||||
"html-escaper": "3.0.3",
|
||||
"lit": "2.7.2",
|
||||
"lit": "2.7.3",
|
||||
"lit-translate": "2.0.1",
|
||||
"passive-events-support": "1.0.33",
|
||||
"rollup": "3.20.7",
|
||||
"rollup": "3.21.1",
|
||||
"rollup-plugin-node-globals": "1.4.0",
|
||||
"rollup-plugin-progress": "1.1.2"
|
||||
|
||||
|
@ -10,7 +10,6 @@ import Highlight from '@tiptap/extension-highlight'
|
||||
import {unsafeHTML} from 'lit/directives/unsafe-html.js';
|
||||
import { Editor, Extension } from '@tiptap/core'
|
||||
import * as zip from "@zip.js/zip.js";
|
||||
import { saveAs } from 'file-saver';
|
||||
import './ChatGifs/ChatGifs.js';
|
||||
|
||||
import localForage from "localforage";
|
||||
@ -2514,7 +2513,7 @@ class ChatPage extends LitElement {
|
||||
if (this.isReceipient) {
|
||||
const getInitialMessages = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/chat/messages?involving=${window.parent.reduxStore.getState().app.selectedAddress.address}&involving=${this._chatId}&limit=${limit}&reverse=true&before=${before}&after=${after}&haschatreference=false`,
|
||||
url: `/chat/messages?involving=${window.parent.reduxStore.getState().app.selectedAddress.address}&involving=${this._chatId}&limit=${limit}&reverse=true&before=${before}&after=${after}&haschatreference=false&encoding=BASE64`,
|
||||
});
|
||||
|
||||
const decodeMsgs = getInitialMessages.map((eachMessage) => {
|
||||
@ -2548,7 +2547,7 @@ class ChatPage extends LitElement {
|
||||
} else {
|
||||
const getInitialMessages = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/chat/messages?txGroupId=${Number(this._chatId)}&limit=${limit}&reverse=true&before=${before}&after=${after}&haschatreference=false`,
|
||||
url: `/chat/messages?txGroupId=${Number(this._chatId)}&limit=${limit}&reverse=true&before=${before}&after=${after}&haschatreference=false&encoding=BASE64`,
|
||||
});
|
||||
|
||||
|
||||
@ -2589,7 +2588,7 @@ class ChatPage extends LitElement {
|
||||
if (this.isReceipient) {
|
||||
const getInitialMessages = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/chat/messages?involving=${window.parent.reduxStore.getState().app.selectedAddress.address}&involving=${this._chatId}&limit=20&reverse=true&before=${scrollElement.messageObj.timestamp}&haschatreference=false`,
|
||||
url: `/chat/messages?involving=${window.parent.reduxStore.getState().app.selectedAddress.address}&involving=${this._chatId}&limit=20&reverse=true&before=${scrollElement.messageObj.timestamp}&haschatreference=false&encoding=BASE64`,
|
||||
});
|
||||
|
||||
const decodeMsgs = getInitialMessages.map((eachMessage) => {
|
||||
@ -2622,7 +2621,7 @@ class ChatPage extends LitElement {
|
||||
} else {
|
||||
const getInitialMessages = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/chat/messages?txGroupId=${Number(this._chatId)}&limit=20&reverse=true&before=${scrollElement.messageObj.timestamp}&haschatreference=false`,
|
||||
url: `/chat/messages?txGroupId=${Number(this._chatId)}&limit=20&reverse=true&before=${scrollElement.messageObj.timestamp}&haschatreference=false&encoding=BASE64`,
|
||||
});
|
||||
|
||||
|
||||
@ -2660,7 +2659,7 @@ class ChatPage extends LitElement {
|
||||
if (this.isReceipient) {
|
||||
const getInitialMessages = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/chat/messages?involving=${window.parent.reduxStore.getState().app.selectedAddress.address}&involving=${this._chatId}&limit=20&reverse=true&afer=${scrollElement.messageObj.timestamp}&haschatreference=false`,
|
||||
url: `/chat/messages?involving=${window.parent.reduxStore.getState().app.selectedAddress.address}&involving=${this._chatId}&limit=20&reverse=true&afer=${scrollElement.messageObj.timestamp}&haschatreference=false&encoding=BASE64`,
|
||||
});
|
||||
|
||||
const decodeMsgs = getInitialMessages.map((eachMessage) => {
|
||||
@ -2693,7 +2692,7 @@ class ChatPage extends LitElement {
|
||||
} else {
|
||||
const getInitialMessages = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/chat/messages?txGroupId=${Number(this._chatId)}&limit=20&reverse=true&after=${scrollElement.messageObj.timestamp}&haschatreference=false`,
|
||||
url: `/chat/messages?txGroupId=${Number(this._chatId)}&limit=20&reverse=true&after=${scrollElement.messageObj.timestamp}&haschatreference=false&encoding=BASE64`,
|
||||
});
|
||||
|
||||
|
||||
@ -2739,8 +2738,7 @@ class ChatPage extends LitElement {
|
||||
let _eachMessage = this.decodeMessage(eachMessage)
|
||||
return _eachMessage
|
||||
}
|
||||
})
|
||||
|
||||
})
|
||||
if (isInitial) {
|
||||
this.chatEditorPlaceholder = await this.renderPlaceholder();
|
||||
const replacedMessages = await replaceMessagesEdited({
|
||||
@ -2759,6 +2757,7 @@ class ChatPage extends LitElement {
|
||||
// TODO: Determine number of initial messages by screen height...
|
||||
this.messagesRendered = this._messages;
|
||||
this.isLoadingMessages = false;
|
||||
|
||||
setTimeout(() => this.downElementObserver(), 500);
|
||||
} else {
|
||||
const replacedMessages = await replaceMessagesEdited({
|
||||
@ -2885,11 +2884,10 @@ class ChatPage extends LitElement {
|
||||
if (isReceipientVar === true) {
|
||||
// direct chat
|
||||
if (encodedMessageObj.isEncrypted === true && _publicKeyVar.hasPubKey === true && encodedMessageObj.data) {
|
||||
let decodedMessage = window.parent.decryptChatMessage(encodedMessageObj.data, window.parent.reduxStore.getState().app.selectedAddress.keyPair.privateKey, _publicKeyVar.key, encodedMessageObj.reference);
|
||||
let decodedMessage = window.parent.decryptChatMessageBase64(encodedMessageObj.data, window.parent.reduxStore.getState().app.selectedAddress.keyPair.privateKey, _publicKeyVar.key, encodedMessageObj.reference);
|
||||
decodedMessageObj = { ...encodedMessageObj, decodedMessage };
|
||||
} else if (encodedMessageObj.isEncrypted === false && encodedMessageObj.data) {
|
||||
let bytesArray = window.parent.Base58.decode(encodedMessageObj.data);
|
||||
let decodedMessage = new TextDecoder('utf-8').decode(bytesArray);
|
||||
let decodedMessage = window.parent.Base64.decode(encodedMessageObj.data);
|
||||
decodedMessageObj = { ...encodedMessageObj, decodedMessage };
|
||||
} else {
|
||||
decodedMessageObj = { ...encodedMessageObj, decodedMessage: "Cannot Decrypt Message!" };
|
||||
@ -2897,8 +2895,7 @@ class ChatPage extends LitElement {
|
||||
|
||||
} else {
|
||||
// group chat
|
||||
let bytesArray = window.parent.Base58.decode(encodedMessageObj.data);
|
||||
let decodedMessage = new TextDecoder('utf-8').decode(bytesArray);
|
||||
let decodedMessage = window.parent.Base64.decode(encodedMessageObj.data);
|
||||
decodedMessageObj = { ...encodedMessageObj, decodedMessage };
|
||||
}
|
||||
|
||||
@ -2942,13 +2939,13 @@ class ChatPage extends LitElement {
|
||||
const lastMessage = cachedData[cachedData.length - 1]
|
||||
const newMessages = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/chat/messages?involving=${window.parent.reduxStore.getState().app.selectedAddress.address}&involving=${cid}&limit=20&reverse=true&after=${lastMessage.timestamp}&haschatreference=false`,
|
||||
url: `/chat/messages?involving=${window.parent.reduxStore.getState().app.selectedAddress.address}&involving=${cid}&limit=20&reverse=true&after=${lastMessage.timestamp}&haschatreference=false&encoding=BASE64`,
|
||||
});
|
||||
getInitialMessages = [...cachedData, ...newMessages].slice(-20)
|
||||
} else {
|
||||
getInitialMessages = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/chat/messages?involving=${window.parent.reduxStore.getState().app.selectedAddress.address}&involving=${cid}&limit=20&reverse=true&haschatreference=false`,
|
||||
url: `/chat/messages?involving=${window.parent.reduxStore.getState().app.selectedAddress.address}&involving=${cid}&limit=20&reverse=true&haschatreference=false&encoding=BASE64`,
|
||||
});
|
||||
|
||||
|
||||
@ -2959,9 +2956,14 @@ class ChatPage extends LitElement {
|
||||
initial = initial + 1
|
||||
|
||||
} else {
|
||||
try {
|
||||
if(e.data){
|
||||
this.processMessages(JSON.parse(e.data), false)
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -3037,17 +3039,15 @@ class ChatPage extends LitElement {
|
||||
|
||||
const newMessages = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/chat/messages?txGroupId=${groupId}&limit=20&reverse=true&after=${lastMessage.timestamp}&haschatreference=false`,
|
||||
url: `/chat/messages?txGroupId=${groupId}&limit=20&reverse=true&after=${lastMessage.timestamp}&haschatreference=false&encoding=BASE64`,
|
||||
});
|
||||
|
||||
getInitialMessages = [...cachedData, ...newMessages].slice(-20)
|
||||
} else {
|
||||
getInitialMessages = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
url: `/chat/messages?txGroupId=${groupId}&limit=20&reverse=true&haschatreference=false`,
|
||||
url: `/chat/messages?txGroupId=${groupId}&limit=20&reverse=true&haschatreference=false&encoding=BASE64`,
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -3055,9 +3055,14 @@ class ChatPage extends LitElement {
|
||||
|
||||
initial = initial + 1
|
||||
} else {
|
||||
if(e.data){
|
||||
this.processMessages(JSON.parse(e.data), false)
|
||||
try {
|
||||
if (e.data) {
|
||||
this.processMessages(JSON.parse(e.data), false)
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,6 @@ import '@material/mwc-dialog';
|
||||
import '@material/mwc-icon';
|
||||
import { EmojiPicker } from 'emoji-picker-js';
|
||||
import { generateHTML } from '@tiptap/core';
|
||||
import { saveAs } from 'file-saver';
|
||||
import axios from "axios";
|
||||
import StarterKit from '@tiptap/starter-kit'
|
||||
import Underline from '@tiptap/extension-underline';
|
||||
@ -28,6 +27,112 @@ import Highlight from '@tiptap/extension-highlight'
|
||||
|
||||
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
|
||||
let toggledMessage = {}
|
||||
|
||||
const getApiKey = () => {
|
||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node];
|
||||
let apiKey = myNode.apiKey;
|
||||
return apiKey;
|
||||
}
|
||||
|
||||
const extractComponents = async (url) => {
|
||||
if (!url.startsWith("qortal://")) {
|
||||
return null;
|
||||
}
|
||||
|
||||
url = url.replace(/^(qortal\:\/\/)/, "");
|
||||
if (url.includes("/")) {
|
||||
let parts = url.split("/");
|
||||
const service = parts[0].toUpperCase();
|
||||
parts.shift();
|
||||
const name = parts[0];
|
||||
parts.shift();
|
||||
let identifier;
|
||||
|
||||
if (parts.length > 0) {
|
||||
identifier = parts[0]; // Do not shift yet
|
||||
// Check if a resource exists with this service, name and identifier combination
|
||||
let responseObj = await parentEpml.request('apiCall', {
|
||||
url: `/arbitrary/resource/status/${service}/${name}/${identifier}?apiKey=${getApiKey()}`
|
||||
})
|
||||
|
||||
if (responseObj.totalChunkCount > 0) {
|
||||
// Identifier exists, so don't include it in the path
|
||||
parts.shift();
|
||||
}
|
||||
else {
|
||||
identifier = null;
|
||||
}
|
||||
}
|
||||
|
||||
const path = parts.join("/");
|
||||
|
||||
const components = {};
|
||||
components["service"] = service;
|
||||
components["name"] = name;
|
||||
components["identifier"] = identifier;
|
||||
components["path"] = path;
|
||||
return components;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function processText(input) {
|
||||
const linkRegex = /(qortal:\/\/\S+)/g;
|
||||
|
||||
function processNode(node) {
|
||||
if (node.nodeType === Node.TEXT_NODE) {
|
||||
const parts = node.textContent.split(linkRegex);
|
||||
|
||||
if (parts.length > 1) {
|
||||
const fragment = document.createDocumentFragment();
|
||||
|
||||
parts.forEach((part) => {
|
||||
if (part.startsWith('qortal://')) {
|
||||
const link = document.createElement('span');
|
||||
// Store the URL in a data attribute
|
||||
link.setAttribute('data-url', part);
|
||||
link.textContent = part;
|
||||
link.style.color = 'var(--nav-text-color)';
|
||||
link.style.textDecoration = 'underline';
|
||||
link.style.cursor = 'pointer'
|
||||
|
||||
link.addEventListener('click', async (e) => {
|
||||
e.preventDefault();
|
||||
try {
|
||||
const res = await extractComponents(part)
|
||||
if (!res) return
|
||||
const { service, name, identifier, path } = res
|
||||
window.location = `../../qdn/browser/index.html?service=${service}&name=${name}&identifier=${identifier}&path=${path}`
|
||||
} catch (error) {
|
||||
console.log({ error })
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
fragment.appendChild(link);
|
||||
} else {
|
||||
const textNode = document.createTextNode(part);
|
||||
fragment.appendChild(textNode);
|
||||
}
|
||||
});
|
||||
|
||||
node.replaceWith(fragment);
|
||||
}
|
||||
} else {
|
||||
for (const childNode of Array.from(node.childNodes)) {
|
||||
processNode(childNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const wrapper = document.createElement('div');
|
||||
wrapper.innerHTML = input;
|
||||
|
||||
processNode(wrapper);
|
||||
|
||||
return wrapper
|
||||
}
|
||||
class ChatScroller extends LitElement {
|
||||
static get properties() {
|
||||
return {
|
||||
@ -61,7 +166,9 @@ class ChatScroller extends LitElement {
|
||||
}
|
||||
}
|
||||
|
||||
static styles = [chatStyles]
|
||||
static get styles() {
|
||||
return [chatStyles];
|
||||
}
|
||||
|
||||
constructor() {
|
||||
super()
|
||||
@ -103,7 +210,10 @@ class ChatScroller extends LitElement {
|
||||
const isSameGroup = Math.abs(timestamp - message.timestamp) < 600000 && sender === message.sender && !repliedToData;
|
||||
|
||||
if (isSameGroup) {
|
||||
messageArray[messageArray.length - 1].messages = [...(messageArray[messageArray.length - 1]?.messages || []), message];
|
||||
messageArray[messageArray.length - 1].messages = [
|
||||
...(messageArray[messageArray.length - 1].messages || []),
|
||||
message
|
||||
];
|
||||
} else {
|
||||
messageArray.push({
|
||||
messages: [message],
|
||||
@ -324,7 +434,10 @@ class MessageTemplate extends LitElement {
|
||||
this.viewImage = false
|
||||
}
|
||||
|
||||
static styles = [chatStyles]
|
||||
static get styles() {
|
||||
return [chatStyles];
|
||||
}
|
||||
|
||||
|
||||
// Open & Close Private Message Chat Modal
|
||||
showPrivateMessageModal() {
|
||||
@ -362,14 +475,34 @@ class MessageTemplate extends LitElement {
|
||||
.then(response =>{
|
||||
let filename = attachment.attachmentName;
|
||||
let blob = new Blob([response.data], { type:"application/octet-stream" });
|
||||
saveAs(blob , filename);
|
||||
this.saveFileToDisk(blob , filename);
|
||||
})
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
async saveFileToDisk(blob, fileName) {
|
||||
try {
|
||||
const fileHandle = await self.showSaveFilePicker({
|
||||
suggestedName: fileName,
|
||||
types: [{
|
||||
description: "File",
|
||||
}]
|
||||
})
|
||||
const writeFile = async (fileHandle, contents) => {
|
||||
const writable = await fileHandle.createWritable()
|
||||
await writable.write(contents)
|
||||
await writable.close()
|
||||
}
|
||||
writeFile(fileHandle, blob).then(() => console.log("FILE SAVED"))
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
firstUpdated(){
|
||||
const autoSeeChatList = window.parent.reduxStore.getState().app?.autoLoadImageChats
|
||||
const autoSeeChatList = window.parent.reduxStore.getState().app.autoLoadImageChats
|
||||
if(autoSeeChatList.includes(this.chatId) || this.listSeenMessages.includes(this.messageObj.signature)){
|
||||
this.viewImage = true
|
||||
}
|
||||
@ -386,6 +519,7 @@ class MessageTemplate extends LitElement {
|
||||
const hidemsg = this.hideMessages;
|
||||
let message = "";
|
||||
let messageVersion2 = ""
|
||||
let messageVersion2WithLink = null
|
||||
let reactions = [];
|
||||
let repliedToData = null;
|
||||
let image = null;
|
||||
@ -405,6 +539,8 @@ class MessageTemplate extends LitElement {
|
||||
Highlight
|
||||
// other extensions …
|
||||
])
|
||||
messageVersion2WithLink = processText(messageVersion2)
|
||||
|
||||
}
|
||||
message = parsedMessageObj.messageText;
|
||||
repliedToData = this.messageObj.repliedToData;
|
||||
@ -424,7 +560,6 @@ class MessageTemplate extends LitElement {
|
||||
gif = parsedMessageObj.gifs[0];
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
message = this.messageObj.decodedMessage;
|
||||
}
|
||||
let avatarImg = '';
|
||||
@ -550,8 +685,28 @@ class MessageTemplate extends LitElement {
|
||||
}
|
||||
|
||||
}
|
||||
const escapedMessage = this.escapeHTML(message)
|
||||
const replacedMessage = escapedMessage.replace(new RegExp('\r?\n','g'), '<br />');
|
||||
let repliedToMessageText = ''
|
||||
if (repliedToData && repliedToData.decodedMessage && repliedToData.decodedMessage.messageText) {
|
||||
try {
|
||||
repliedToMessageText = generateHTML(repliedToData.decodedMessage.messageText, [
|
||||
StarterKit,
|
||||
Underline,
|
||||
Highlight
|
||||
// other extensions …
|
||||
])
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
}
|
||||
let replacedMessage = ''
|
||||
if (message && +version < 2) {
|
||||
const escapedMessage = this.escapeHTML(message)
|
||||
if (escapedMessage) {
|
||||
replacedMessage = escapedMessage.replace(new RegExp('\r?\n', 'g'), '<br />');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return hideit ? html`<li class="clearfix"></li>` : html`
|
||||
<li
|
||||
@ -645,16 +800,11 @@ class MessageTemplate extends LitElement {
|
||||
${repliedToData.senderName ? repliedToData.senderName : cropAddress(repliedToData.sender) }
|
||||
</p>
|
||||
<p class="replied-message">
|
||||
${version.toString() === '1' ? html`
|
||||
${version && version.toString() === '1' ? html`
|
||||
${repliedToData.decodedMessage.messageText}
|
||||
` : ''}
|
||||
${+version > 1 ? html`
|
||||
${unsafeHTML(generateHTML(repliedToData.decodedMessage.messageText, [
|
||||
StarterKit,
|
||||
Underline,
|
||||
Highlight
|
||||
// other extensions …
|
||||
]))}
|
||||
${+version > 1 && repliedToMessageText ? html`
|
||||
${unsafeHTML(repliedToMessageText)}
|
||||
`
|
||||
: ''}
|
||||
</p>
|
||||
@ -764,13 +914,14 @@ class MessageTemplate extends LitElement {
|
||||
id="messageContent"
|
||||
class="message"
|
||||
style=${(image && replacedMessage !== "") &&"margin-top: 15px;"}>
|
||||
${+version > 1 ? html`
|
||||
${+version > 1 ? messageVersion2WithLink ? html`${messageVersion2WithLink}` : html`
|
||||
${unsafeHTML(messageVersion2)}
|
||||
` : ''}
|
||||
${version.toString() === '1' ? html`
|
||||
|
||||
${version && version.toString() === '1' ? html`
|
||||
${unsafeHTML(this.emojiPicker.parse(replacedMessage))}
|
||||
` : ''}
|
||||
${version.toString() === '0' ? html`
|
||||
${version && version.toString() === '0' ? html`
|
||||
${unsafeHTML(this.emojiPicker.parse(replacedMessage))}
|
||||
` : ''}
|
||||
<div
|
||||
@ -1039,7 +1190,9 @@ class ChatMenu extends LitElement {
|
||||
this.showBlockUserModal = () => {};
|
||||
}
|
||||
|
||||
static styles = [chatStyles]
|
||||
static get styles() {
|
||||
return [chatStyles];
|
||||
}
|
||||
|
||||
// Copy address to clipboard
|
||||
async copyToClipboard(text) {
|
||||
|
@ -696,7 +696,7 @@ class QApps extends LitElement {
|
||||
|
||||
getArbitraryResources = async () => {
|
||||
const resources = await parentEpml.request('apiCall', {
|
||||
url: `/arbitrary/resources?service=${this.service}&default=true&limit=0&reverse=false&includestatus=false&includemetadata=false`
|
||||
url: `/arbitrary/resources?service=${this.service}&default=true&limit=0&reverse=false&includestatus=false&includemetadata=false&excludeblocked=true`
|
||||
})
|
||||
this.resources = resources
|
||||
}
|
||||
@ -732,7 +732,7 @@ class QApps extends LitElement {
|
||||
async getData(offset) {
|
||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
const nodeUrl = myNode.protocol + '://' + myNode.domain + ':' + myNode.port
|
||||
let jsonOffsetUrl = `${nodeUrl}/arbitrary/resources?service=APP&default=true&limit=20&offset=${offset}&reverse=false&includestatus=true&includemetadata=true`
|
||||
let jsonOffsetUrl = `${nodeUrl}/arbitrary/resources?service=APP&default=true&limit=20&offset=${offset}&reverse=false&includestatus=true&includemetadata=true&excludeblocked=true`
|
||||
|
||||
const jsonOffsetRes = await fetch(jsonOffsetUrl)
|
||||
const jsonOffsetData = await jsonOffsetRes.json()
|
||||
@ -760,7 +760,7 @@ class QApps extends LitElement {
|
||||
} else {
|
||||
offset = 0
|
||||
}
|
||||
this.getData(offset);
|
||||
this.getData(offset)
|
||||
const selectedPage = parseInt(this.pagesControl.querySelector('[selected]').textContent)
|
||||
this.updateItemsFromPage(selectedPage - 1)
|
||||
})
|
||||
@ -776,7 +776,7 @@ class QApps extends LitElement {
|
||||
} else {
|
||||
offset = 0
|
||||
}
|
||||
this.getData(offset);
|
||||
this.getData(offset)
|
||||
this.updateItemsFromPage(parseInt(e.target.textContent))
|
||||
})
|
||||
if (pageNumber === page) {
|
||||
@ -793,7 +793,7 @@ class QApps extends LitElement {
|
||||
} else {
|
||||
offset = 0
|
||||
}
|
||||
this.getData(offset);
|
||||
this.getData(offset)
|
||||
const selectedPage = parseInt(this.pagesControl.querySelector('[selected]').textContent)
|
||||
this.updateItemsFromPage(selectedPage + 1)
|
||||
})
|
||||
@ -831,6 +831,12 @@ class QApps extends LitElement {
|
||||
await this.updateItemsFromPage(1, true)
|
||||
}
|
||||
|
||||
async refreshapps() {
|
||||
await this.getData(0)
|
||||
await this.getArbitraryResources()
|
||||
await this.updateItemsFromPage(1, true)
|
||||
}
|
||||
|
||||
doSearch(e) {
|
||||
this.searchResult()
|
||||
}
|
||||
@ -1008,7 +1014,7 @@ class QApps extends LitElement {
|
||||
this.followedNames.push(name)
|
||||
this.getFollowedNamesRefresh()
|
||||
this.getFollowedNamesResource()
|
||||
this.getArbitraryResources()
|
||||
this.refreshapps()
|
||||
this.updateComplete.then(() => this.requestUpdate())
|
||||
} else {
|
||||
let err3string = get("appspage.schange22")
|
||||
@ -1037,7 +1043,7 @@ class QApps extends LitElement {
|
||||
this.followedNames = this.followedNames.filter(item => item != name)
|
||||
this.getFollowedNamesRefresh()
|
||||
this.getFollowedNamesResource()
|
||||
this.getArbitraryResources()
|
||||
this.refreshapps()
|
||||
this.updateComplete.then(() => this.requestUpdate())
|
||||
} else {
|
||||
let err4string = get("appspage.schange23")
|
||||
@ -1067,7 +1073,7 @@ class QApps extends LitElement {
|
||||
this.blockedNames.push(name)
|
||||
this.getBlockedNamesRefresh()
|
||||
this.getBlockedNamesResource()
|
||||
this.getArbitraryResources()
|
||||
this.refreshapps()
|
||||
this.updateComplete.then(() => this.requestUpdate())
|
||||
} else {
|
||||
let err5string = get("appspage.schange24")
|
||||
@ -1096,7 +1102,7 @@ class QApps extends LitElement {
|
||||
this.blockedNames = this.blockedNames.filter(item => item != name)
|
||||
this.getBlockedNamesRefresh()
|
||||
this.getBlockedNamesResource()
|
||||
this.getArbitraryResources()
|
||||
this.refreshapps()
|
||||
this.updateComplete.then(() => this.requestUpdate())
|
||||
} else {
|
||||
let err6string = get("appspage.schange25")
|
||||
|
@ -146,15 +146,15 @@ class WebBrowser extends LitElement {
|
||||
// Build initial display URL
|
||||
let displayUrl = 'qortal://' + this.service + '/' + this.name;
|
||||
if (
|
||||
this.identifier != null &&
|
||||
data.identifier != '' &&
|
||||
this.identifier && this.identifier != 'null' &&
|
||||
this.identifier != 'default'
|
||||
)
|
||||
{
|
||||
displayUrl = displayUrl.concat('/' + this.identifier);
|
||||
}
|
||||
if (this.path != null && this.path != '/')
|
||||
displayUrl = displayUrl.concat(this.path);
|
||||
this.displayUrl = displayUrl;
|
||||
|
||||
const getFollowedNames = async () => {
|
||||
let followedNames = await parentEpml.request('apiCall', {
|
||||
url: `/lists/followedNames?apiKey=${this.getApiKey()}`,
|
||||
@ -193,8 +193,9 @@ class WebBrowser extends LitElement {
|
||||
}
|
||||
else {
|
||||
// Normal mode
|
||||
|
||||
this.url = `${nodeUrl}/render/${this.service}/${this.name}${this.path != null ? this.path : ''
|
||||
}?theme=${this.theme}&identifier=${this.identifier != null ? this.identifier : ''
|
||||
}?theme=${this.theme}&identifier=${(this.identifier != null && this.identifier != 'null') ? this.identifier : ''
|
||||
}`
|
||||
}
|
||||
}
|
||||
|
@ -541,7 +541,7 @@ class Websites extends LitElement {
|
||||
|
||||
getArbitraryResources = async () => {
|
||||
const resources = await parentEpml.request('apiCall', {
|
||||
url: `/arbitrary/resources?service=${this.service}&default=true&limit=0&reverse=false&includestatus=false&includemetadata=false`
|
||||
url: `/arbitrary/resources?service=${this.service}&default=true&limit=0&reverse=false&includestatus=false&includemetadata=false&excludeblocked=true`
|
||||
})
|
||||
this.resources = resources
|
||||
}
|
||||
@ -577,7 +577,7 @@ class Websites extends LitElement {
|
||||
async getData(offset) {
|
||||
const myNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
||||
const nodeUrl = myNode.protocol + '://' + myNode.domain + ':' + myNode.port
|
||||
let jsonOffsetUrl = `${nodeUrl}/arbitrary/resources?service=WEBSITE&default=true&limit=20&offset=${offset}&reverse=false&includestatus=true&includemetadata=true`
|
||||
let jsonOffsetUrl = `${nodeUrl}/arbitrary/resources?service=WEBSITE&default=true&limit=20&offset=${offset}&reverse=false&includestatus=true&includemetadata=true&excludeblocked=true`
|
||||
|
||||
const jsonOffsetRes = await fetch(jsonOffsetUrl)
|
||||
const jsonOffsetData = await jsonOffsetRes.json()
|
||||
@ -676,6 +676,12 @@ class Websites extends LitElement {
|
||||
await this.updateItemsFromPage(1, true)
|
||||
}
|
||||
|
||||
async refreshWebsites() {
|
||||
await this.getData(0)
|
||||
await this.getArbitraryResources()
|
||||
await this.updateItemsFromPage(1, true)
|
||||
}
|
||||
|
||||
doSearch(e) {
|
||||
this.searchResult()
|
||||
}
|
||||
@ -753,7 +759,7 @@ class Websites extends LitElement {
|
||||
this.followedNames.push(name)
|
||||
this.getFollowedNamesRefresh()
|
||||
this.getFollowedNamesResource()
|
||||
this.getArbitraryResources()
|
||||
this.refreshWebsites()
|
||||
this.updateComplete.then(() => this.requestUpdate())
|
||||
} else {
|
||||
let err3string = get("websitespage.schange22")
|
||||
@ -783,7 +789,7 @@ class Websites extends LitElement {
|
||||
this.followedNames = this.followedNames.filter(item => item != name)
|
||||
this.getFollowedNamesRefresh()
|
||||
this.getFollowedNamesResource()
|
||||
this.getArbitraryResources()
|
||||
this.refreshWebsites()
|
||||
this.updateComplete.then(() => this.requestUpdate())
|
||||
} else {
|
||||
let err4string = get("websitespage.schange23")
|
||||
@ -816,7 +822,7 @@ class Websites extends LitElement {
|
||||
this.blockedNames.push(name)
|
||||
this.getBlockedNamesRefresh()
|
||||
this.getBlockedNamesResource()
|
||||
this.getArbitraryResources()
|
||||
this.refreshWebsites()
|
||||
this.updateComplete.then(() => this.requestUpdate())
|
||||
} else {
|
||||
let err5string = get("websitespage.schange24")
|
||||
@ -846,7 +852,7 @@ class Websites extends LitElement {
|
||||
this.blockedNames = this.blockedNames.filter(item => item != name)
|
||||
this.getBlockedNamesRefresh()
|
||||
this.getBlockedNamesResource()
|
||||
this.getArbitraryResources()
|
||||
this.refreshWebsites()
|
||||
this.updateComplete.then(() => this.requestUpdate())
|
||||
} else {
|
||||
let err6string = get("websitespage.schange25")
|
||||
|
@ -11,7 +11,6 @@ import '../components/ButtonIconCopy.js'
|
||||
import '../components/QortalQrcodeGenerator.js'
|
||||
import '../components/frag-file-input.js'
|
||||
import '../components/time-elements/index.js'
|
||||
import FileSaver from 'file-saver'
|
||||
import '@material/mwc-button'
|
||||
import '@material/mwc-checkbox'
|
||||
import '@material/mwc-dialog'
|
||||
@ -3723,52 +3722,66 @@ class MultiWallet extends LitElement {
|
||||
}
|
||||
|
||||
exportQortAddressbook() {
|
||||
let bookname = ""
|
||||
const qortBookData = JSON.stringify(localStorage.getItem("addressbookQort"))
|
||||
const qortBookSave = JSON.parse((qortBookData) || "[]")
|
||||
const blob = new Blob([qortBookSave], { type: 'text/plain;charset=utf-8' })
|
||||
FileSaver.saveAs(blob, `qortal_addressbook.qort.json`)
|
||||
bookname = "qortal_addressbook.qort.json"
|
||||
this.saveFileToDisk(blob, bookname)
|
||||
}
|
||||
|
||||
exportBtcAddressbook() {
|
||||
let bookname = ""
|
||||
const btcBookData = JSON.stringify(localStorage.getItem("addressbookBtc"))
|
||||
const btcBookSave = JSON.parse((btcBookData) || "[]")
|
||||
const blob = new Blob([btcBookSave], { type: 'text/plain;charset=utf-8' })
|
||||
FileSaver.saveAs(blob, `bitcoin_addressbook.btc.json`)
|
||||
bookname = "bitcoin_addressbook.btc.json"
|
||||
this.saveFileToDisk(blob, bookname)
|
||||
}
|
||||
|
||||
exportLtcAddressbook() {
|
||||
let bookname = ""
|
||||
const ltcBookData = JSON.stringify(localStorage.getItem("addressbookLtc"))
|
||||
const ltcBookSave = JSON.parse((ltcBookData) || "[]")
|
||||
const blob = new Blob([ltcBookSave], { type: 'text/plain;charset=utf-8' })
|
||||
FileSaver.saveAs(blob, `litecoin_addressbook.ltc.json`)
|
||||
bookname = "litecoin_addressbook.ltc.json"
|
||||
this.saveFileToDisk(blob, bookname)
|
||||
}
|
||||
|
||||
exportDogeAddressbook() {
|
||||
let bookname = ""
|
||||
const dogeBookData = JSON.stringify(localStorage.getItem("addressbookDoge"))
|
||||
const dogeBookSave = JSON.parse((dogeBookData) || "[]")
|
||||
const blob = new Blob([dogeBookSave], { type: 'text/plain;charset=utf-8' })
|
||||
FileSaver.saveAs(blob, `dogecoin_addressbook.doge.json`)
|
||||
bookname = "dogecoin_addressbook.doge.json"
|
||||
this.saveFileToDisk(blob, bookname)
|
||||
}
|
||||
|
||||
exportDgbAddressbook() {
|
||||
let bookname = ""
|
||||
const dgbBookData = JSON.stringify(localStorage.getItem("addressbookDgb"))
|
||||
const dgbBookSave = JSON.parse((dgbBookData) || "[]")
|
||||
const blob = new Blob([dgbBookSave], { type: 'text/plain;charset=utf-8' })
|
||||
FileSaver.saveAs(blob, `digibyte_addressbook.dgb.json`)
|
||||
bookname = "digibyte_addressbook.dgb.json"
|
||||
this.saveFileToDisk(blob, bookname)
|
||||
}
|
||||
|
||||
exportRvnAddressbook() {
|
||||
let bookname = ""
|
||||
const rvnBookData = JSON.stringify(localStorage.getItem("addressbookRvn"))
|
||||
const rvnBookSave = JSON.parse((rvnBookData) || "[]")
|
||||
const blob = new Blob([rvnBookSave], { type: 'text/plain;charset=utf-8' })
|
||||
FileSaver.saveAs(blob, `ravencoin_addressbook.rvn.json`)
|
||||
bookname = "ravencoin_addressbook.rvn.json"
|
||||
this.saveFileToDisk(blob, bookname)
|
||||
}
|
||||
|
||||
exportArrrAddressbook() {
|
||||
let bookname = ""
|
||||
const arrrBookData = JSON.stringify(localStorage.getItem("addressbookArrr"))
|
||||
const arrrBookSave = JSON.parse((arrrBookData) || "[]")
|
||||
const blob = new Blob([arrrBookSave], { type: 'text/plain;charset=utf-8' })
|
||||
FileSaver.saveAs(blob, `piratechain_addressbook.arrr.json`)
|
||||
bookname = "piratechain_addressbook.arrr.json"
|
||||
this.saveFileToDisk(blob, bookname)
|
||||
}
|
||||
|
||||
importQortAddressbook(file) {
|
||||
@ -4947,7 +4960,7 @@ class MultiWallet extends LitElement {
|
||||
} else if ( this._selectedWallet === "btc" ) {
|
||||
return html`<vaadin-button theme="primary small" style="width: 100%;" @click=${() => this.exportBtcAddressbook()}><vaadin-icon icon="vaadin:cloud-download" slot="prefix"></vaadin-icon> ${translate("walletpage.wchange54")}</vaadin-button>`
|
||||
} else if ( this._selectedWallet === "ltc" ) {
|
||||
return html`<vaadin-button theme="primary small" style="width: 100%;" @click=${() => this.exportKLtcAddressbook()}><vaadin-icon icon="vaadin:cloud-download" slot="prefix"></vaadin-icon> ${translate("walletpage.wchange54")}</vaadin-button>`
|
||||
return html`<vaadin-button theme="primary small" style="width: 100%;" @click=${() => this.exportLtcAddressbook()}><vaadin-icon icon="vaadin:cloud-download" slot="prefix"></vaadin-icon> ${translate("walletpage.wchange54")}</vaadin-button>`
|
||||
} else if ( this._selectedWallet === "doge" ) {
|
||||
return html`<vaadin-button theme="primary small" style="width: 100%;" @click=${() => this.exportDogeAddressbook()}><vaadin-icon icon="vaadin:cloud-download" slot="prefix"></vaadin-icon> ${translate("walletpage.wchange54")}</vaadin-button>`
|
||||
} else if ( this._selectedWallet === "dgb" ) {
|
||||
@ -5780,6 +5793,27 @@ class MultiWallet extends LitElement {
|
||||
})
|
||||
}
|
||||
|
||||
async saveFileToDisk(blob, fileName) {
|
||||
try {
|
||||
const fileHandle = await self.showSaveFilePicker({
|
||||
suggestedName: fileName,
|
||||
types: [{
|
||||
description: "File",
|
||||
}]
|
||||
})
|
||||
const writeFile = async (fileHandle, contents) => {
|
||||
const writable = await fileHandle.createWritable()
|
||||
await writable.write(contents)
|
||||
await writable.close()
|
||||
}
|
||||
writeFile(fileHandle, blob).then(() => console.log("FILE SAVED"))
|
||||
let snack4string = get("general.save")
|
||||
parentEpml.request('showSnackBar', `${snack4string} ${fileName} ✅`)
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
isEmptyArray(arr) {
|
||||
if (!arr) {
|
||||
return true
|
||||
|
@ -14,7 +14,7 @@ export const replaceMessagesEdited = async ({
|
||||
}
|
||||
const response = await parentEpml.request("apiCall", {
|
||||
type: "api",
|
||||
url: `/chat/messages?chatreference=${msg.signature}&reverse=true${msgQuery}&limit=1&sender=${msg.sender}`,
|
||||
url: `/chat/messages?chatreference=${msg.signature}&reverse=true${msgQuery}&limit=1&sender=${msg.sender}&encoding=BASE64`,
|
||||
})
|
||||
|
||||
if (response && Array.isArray(response) && response.length !== 0) {
|
||||
@ -54,13 +54,13 @@ export const replaceMessagesEdited = async ({
|
||||
if(+parsedMessageObj.version > 2){
|
||||
originalReply = await parentEpml.request("apiCall", {
|
||||
type: "api",
|
||||
url: `/chat/message/${parsedMessageObj.repliedTo}`,
|
||||
url: `/chat/message/${parsedMessageObj.repliedTo}?encoding=BASE64`,
|
||||
})
|
||||
}
|
||||
if(+parsedMessageObj.version < 3){
|
||||
originalReply = await parentEpml.request("apiCall", {
|
||||
type: "api",
|
||||
url: `/chat/messages?reference=${parsedMessageObj.repliedTo}&reverse=true${msgQuery}`,
|
||||
url: `/chat/messages?reference=${parsedMessageObj.repliedTo}&reverse=true${msgQuery}&encoding=BASE64`,
|
||||
})
|
||||
}
|
||||
|
||||
@ -71,7 +71,7 @@ export const replaceMessagesEdited = async ({
|
||||
|
||||
const response = await parentEpml.request("apiCall", {
|
||||
type: "api",
|
||||
url: `/chat/messages?chatreference=${parsedMessageObj.repliedTo}&reverse=true${msgQuery}&limit=1&sender=${originalReplyMessage.sender}`,
|
||||
url: `/chat/messages?chatreference=${parsedMessageObj.repliedTo}&reverse=true${msgQuery}&limit=1&sender=${originalReplyMessage.sender}&encoding=BASE64`,
|
||||
})
|
||||
|
||||
if (
|
||||
|
Loading…
x
Reference in New Issue
Block a user