refactor(utils): remove unused copyToClipboard and generateQRCode functions from sp-address.utils.ts

This commit is contained in:
NicolasCantu 2025-11-26 13:16:58 +01:00
parent 6f508b4b8b
commit 0970d1b0da

View File

@ -1,17 +1,6 @@
import Services from '../services/service'; import Services from '../services/service';
import { getCorrectDOM } from './html.utils'; import { getCorrectDOM } from './html.utils';
import { addSubscription } from './subscription.utils'; import { addSubscription } from './subscription.utils';
import QRCode from 'qrcode';
//Copy Address
export async function copyToClipboard(fullAddress: string) {
try {
await navigator.clipboard.writeText(fullAddress);
alert('Adresse copiée dans le presse-papiers !');
} catch (err) {
console.error('Failed to copy the address: ', err);
}
}
//Generate emojis list //Generate emojis list
export function generateEmojiList(): string[] { export function generateEmojiList(): string[] {
@ -220,18 +209,6 @@ export async function prepareAndSendPairingTx(): Promise<void> {
} }
} }
export async function generateQRCode(spAddress: string) {
try {
const container = getCorrectDOM('login-4nk-component') as HTMLElement;
const currentUrl = 'https://' + window.location.host;
const url = await QRCode.toDataURL(currentUrl + '?sp_address=' + spAddress);
const qrCode = container?.querySelector('.qr-code img');
qrCode?.setAttribute('src', url);
} catch (err) {
console.error(err);
}
}
export async function generateCreateBtn() { export async function generateCreateBtn() {
try { try {
// Generate CreateBtn // Generate CreateBtn