mirror of
https://github.com/Qortal/Qortal-Hub.git
synced 2025-04-30 14:57:51 +00:00
updated external links
This commit is contained in:
parent
fd6411bb30
commit
c0831df541
BIN
electron/assets/splash2.png
Normal file
BIN
electron/assets/splash2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 160 KiB |
@ -2,3 +2,8 @@ require('./rt/electron-rt');
|
|||||||
//////////////////////////////
|
//////////////////////////////
|
||||||
// User Defined Preload scripts below
|
// User Defined Preload scripts below
|
||||||
console.log('User Preload!');
|
console.log('User Preload!');
|
||||||
|
const { contextBridge, shell } = require('electron');
|
||||||
|
|
||||||
|
contextBridge.exposeInMainWorld('electronAPI', {
|
||||||
|
openExternal: (url) => shell.openExternal(url)
|
||||||
|
});
|
@ -12,6 +12,7 @@ import electronServe from 'electron-serve';
|
|||||||
import windowStateKeeper from 'electron-window-state';
|
import windowStateKeeper from 'electron-window-state';
|
||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
|
|
||||||
|
|
||||||
// Define components for a watcher to detect when the webapp is changed so we can reload in Dev mode.
|
// Define components for a watcher to detect when the webapp is changed so we can reload in Dev mode.
|
||||||
const reloadWatcher = {
|
const reloadWatcher = {
|
||||||
debouncer: null,
|
debouncer: null,
|
||||||
|
@ -6,7 +6,6 @@ import {
|
|||||||
useRef,
|
useRef,
|
||||||
useState,
|
useState,
|
||||||
} from "react";
|
} from "react";
|
||||||
import { Browser } from "@capacitor/browser";
|
|
||||||
import "./App.css";
|
import "./App.css";
|
||||||
import { useDropzone } from "react-dropzone";
|
import { useDropzone } from "react-dropzone";
|
||||||
import {
|
import {
|
||||||
@ -1377,7 +1376,7 @@ function App() {
|
|||||||
textDecoration: "underline",
|
textDecoration: "underline",
|
||||||
}}
|
}}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
await Browser.open({ url: "https://www.qort.trade" });
|
window.electronAPI.openExternal("https://www.qort.trade");
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Get QORT at qort.trade
|
Get QORT at qort.trade
|
||||||
@ -2287,7 +2286,7 @@ function App() {
|
|||||||
<CustomButton onClick={async ()=> {
|
<CustomButton onClick={async ()=> {
|
||||||
await saveFileToDiskFunc()
|
await saveFileToDiskFunc()
|
||||||
await showInfo({
|
await showInfo({
|
||||||
message: `Your wallet file was saved to internal storage, in the document folder. Keep that file secure.`,
|
message: `Keep your wallet file secure.`,
|
||||||
})
|
})
|
||||||
}}>
|
}}>
|
||||||
Download wallet
|
Download wallet
|
||||||
@ -2392,7 +2391,7 @@ await showInfo({
|
|||||||
await saveFileToDiskFunc();
|
await saveFileToDiskFunc();
|
||||||
returnToMain();
|
returnToMain();
|
||||||
await showInfo({
|
await showInfo({
|
||||||
message: `Your wallet file was saved to internal storage, in the document folder. Keep that file secure.`,
|
message: `Keep your wallet file secure.`,
|
||||||
})
|
})
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
@ -3,10 +3,10 @@ import { executeEvent } from '../../utils/events';
|
|||||||
import { useSetRecoilState } from 'recoil';
|
import { useSetRecoilState } from 'recoil';
|
||||||
import { navigationControllerAtom } from '../../atoms/global';
|
import { navigationControllerAtom } from '../../atoms/global';
|
||||||
import { Filesystem, Directory, Encoding } from '@capacitor/filesystem';
|
import { Filesystem, Directory, Encoding } from '@capacitor/filesystem';
|
||||||
import { Browser } from '@capacitor/browser';
|
|
||||||
import { saveFile } from '../../qortalRequests/get';
|
import { saveFile } from '../../qortalRequests/get';
|
||||||
import { mimeToExtensionMap } from '../../utils/memeTypes';
|
import { mimeToExtensionMap } from '../../utils/memeTypes';
|
||||||
import { MyContext } from '../../App';
|
import { MyContext } from '../../App';
|
||||||
|
import FileSaver from 'file-saver';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -269,7 +269,7 @@ const UIQortalRequests = [
|
|||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { filename, mimeType, blob } = data;
|
const { filename, mimeType, blob, fileHandleOptions } = data;
|
||||||
|
|
||||||
setInfoSnackCustom({
|
setInfoSnackCustom({
|
||||||
type: "info",
|
type: "info",
|
||||||
@ -280,7 +280,10 @@ const UIQortalRequests = [
|
|||||||
|
|
||||||
setOpenSnackGlobal(true);
|
setOpenSnackGlobal(true);
|
||||||
|
|
||||||
await saveFileInChunks(blob, filename)
|
|
||||||
|
|
||||||
|
FileSaver.saveAs(blob, filename)
|
||||||
|
|
||||||
setInfoSnackCustom({
|
setInfoSnackCustom({
|
||||||
type: "success",
|
type: "success",
|
||||||
message:
|
message:
|
||||||
|
@ -36,8 +36,7 @@ export const MessageDisplay = ({ htmlContent , isReply}) => {
|
|||||||
const target = e.target.closest('a');
|
const target = e.target.closest('a');
|
||||||
if (target) {
|
if (target) {
|
||||||
const href = target.getAttribute('href');
|
const href = target.getAttribute('href');
|
||||||
await Browser.open({ url: href });
|
window.electronAPI.openExternal(href);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
console.error('No <a> tag found or href is null.');
|
console.error('No <a> tag found or href is null.');
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,8 @@ import { crypto, walletVersion } from '../../constants/decryptWallet';
|
|||||||
import { doInitWorkers, kdf } from '../../deps/kdf';
|
import { doInitWorkers, kdf } from '../../deps/kdf';
|
||||||
import PhraseWallet from './phrase-wallet';
|
import PhraseWallet from './phrase-wallet';
|
||||||
import * as WORDLISTS from './wordlists';
|
import * as WORDLISTS from './wordlists';
|
||||||
|
import FileSaver from 'file-saver';
|
||||||
|
|
||||||
import { Filesystem, Directory, Encoding } from '@capacitor/filesystem';
|
import { Filesystem, Directory, Encoding } from '@capacitor/filesystem';
|
||||||
export function generateRandomSentence(template = 'adverb verb noun adjective noun adverb verb noun adjective noun adjective verbed adjective noun', maxWordLength = 0, capitalize = true) {
|
export function generateRandomSentence(template = 'adverb verb noun adjective noun adverb verb noun adjective noun adjective verbed adjective noun', maxWordLength = 0, capitalize = true) {
|
||||||
const partsOfSpeechMap = {
|
const partsOfSpeechMap = {
|
||||||
@ -83,17 +85,12 @@ export const createAccount = async()=> {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const saveFileToDisk = async (data: any, qortAddress: string) => {
|
export const saveFileToDisk = async (data, qortAddress) => {
|
||||||
|
|
||||||
const dataString = JSON.stringify(data);
|
const dataString = JSON.stringify(data);
|
||||||
const fileName = `qortal_backup_${qortAddress}.json`;
|
const blob = new Blob([dataString], { type: 'application/json' });
|
||||||
|
const fileName = "qortal_backup_" + qortAddress + ".json";
|
||||||
|
|
||||||
// Write the file to the Filesystem
|
await FileSaver.saveAs(blob, fileName);
|
||||||
await Filesystem.writeFile({
|
|
||||||
path: fileName,
|
|
||||||
data: dataString,
|
|
||||||
directory: Directory.Documents, // Save in the Documents folder
|
|
||||||
encoding: Encoding.UTF8,
|
|
||||||
});
|
|
||||||
|
|
||||||
};
|
}
|
Loading…
x
Reference in New Issue
Block a user