move login modal

This commit is contained in:
AnisHADJARAB 2024-11-08 09:13:56 +00:00
parent 546a92c45e
commit 6f21551956
4 changed files with 2 additions and 31 deletions

View File

@ -1,5 +1,5 @@
import modalHtml from '../html/login-modal.html?raw';
import modalScript from '../html/login-modal.js?raw';
import modalHtml from '../components/login-modal/login-modal.html?raw';
import modalScript from '../components/login-modal/login-modal.js?raw';
import Services from './service';
import { U32_MAX } from './service';
import { navigate } from '../router';

View File

@ -128,12 +128,10 @@ export default class Services {
}
async sendNewTxMessage(message: string) {
// console.log("🚀 ~ WebSocketClient ~ this.ws.onopen= ~ newTxMessage:", message)
await sendMessage('NewTx', message);
}
async sendCommitMessage(message: string) {
// console.log("🚀 ~ WebSocketClient ~ this.ws.onopen= ~ CommitMessage:", message)
await sendMessage('Commit', message);
}
@ -145,18 +143,9 @@ export default class Services {
}
async sendFaucetMessage(message: string): Promise<void> {
// console.log("🚀 ~ WebSocketClient ~ this.ws.onopen= ~ faucetMessage:", message)
await sendMessage('Faucet', message);
}
async parseCipher(message: string) {
// try {
// JSON.parse(message)
// const router = await Routing.getInstance();
// router.closeLoginModal()
// this.injectProcessListPage()
// } catch {
// console.log('Not proper format for cipher')
// }
try {
console.log('parsing new cipher');
const apiReturn = await this.sdkClient.parse_cipher(message, 0.00001);
@ -170,7 +159,6 @@ export default class Services {
async parseNewTx(tx: string) {
try {
// console.log('==============> sending txxxxxxx parser', tx)
const parsedTx = await this.sdkClient.parse_new_tx(tx, 0, 0.0001);
if (parsedTx) {
console.log('🚀 ~ Services ~ parseNewTx ~ parsedTx:', parsedTx);
@ -293,21 +281,6 @@ export default class Services {
}
}
// async saveTxToDb(tx: CachedMessage) {
// const database = await Database.getInstance();
// const indexedDb = await database.getDb();
// await database.writeObject(indexedDb, 'messages', tx, null);
// }
// async saveCipherTxToDb(tx: string) {
// const database = await Database.getInstance();
// const indexedDb = await database.getDb();
// if(tx) {
// await database.writeObject(indexedDb, database.getStoreList().AnkCipherMessages, tx, null);
// }
// }
async getAmount(): Promise<BigInt> {
const amount = await this.sdkClient.get_available_amount();
return amount;
@ -319,12 +292,10 @@ export default class Services {
async dumpDevice() {
const device = await this.sdkClient.dump_device();
// console.log("🚀 ~ Services ~ dumpDevice ~ device:", device)
return device;
}
async saveDevice(device: any): Promise<any> {
// console.log("🚀 ~ Services ~ saveDevice ~ device:", device)
const db = await Database.getInstance();
db.addObject({
storeName: 'wallet',