Skip to content

Commit

Permalink
Update packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Levminer committed Nov 17, 2021
1 parent fce76c6 commit 232f7fc
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 797 deletions.
23 changes: 11 additions & 12 deletions app/export/src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const { aes, convert, time } = require("@levminer/lib")
const logger = require("@levminer/lib/logger/renderer")
const fs = require("fs")
const path = require("path")
const qrcode = require("qrcode")
const qrcode = require("qrcode-generator")
const ipc = electron.ipcRenderer

// ? error in window
Expand Down Expand Up @@ -82,21 +82,20 @@ const go = (data) => {
const issuers = data.issuers

for (let i = 0; i < names.length; i++) {
qrcode.toDataURL(`otpauth://totp/${names[i]}?secret=${secrets[i]}&issuer=${issuers[i]}`, (err, data) => {
if (err) {
logger.error(`Failed to generate QR code - ${err}`)
}
const qr = qrcode(10, "M")

qr.addData(`otpauth://totp/${names[i]}?secret=${secrets[i]}&issuer=${issuers[i]}`)
qr.make()

qr_data = data
const qr_src = qr.createDataURL(3, 3)

const text = `
<div data-scroll class="qr">
<img class="img" src="${data}">
<h2>${issuers[i]}</h2>
const text = `
<div>
<img class="img" src="${qr_src}">
<h1 style=font-family:Arial;>${issuers[i]}</h1>
</div>`

codes.push(text)
})
codes.push(text)

document.querySelector(".before_export").style.display = "none"
document.querySelector(".after_export").style.display = "block"
Expand Down
8 changes: 1 addition & 7 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const contextmenu = require("electron-context-menu")
const logger = require("@levminer/lib/logger/main")
const { version, tag } = require("./package.json")
const { number, date } = require("./build.json")
const sentry = require("@sentry/electron/main")
const remote = require("@electron/remote/main")
const { markdown } = require("@levminer/lib")
const AutoLaunch = require("auto-launch")
Expand All @@ -18,18 +17,13 @@ const ipc = electron.ipcMain
// ? crash report
process.on("uncaughtException", (error) => {
logger.error("Error on load", error.stack)
dialog.showErrorBox("Authme", `Authme crashed, crash report is sent. \n\nPlease open a GitHub Issue with a screenshot of this error. \n\n${error.stack}`)
dialog.showErrorBox("Authme", `Authme crashed, exiting now. \n\nPlease open a GitHub Issue with a screenshot of this error. \n\n${error.stack}`)

shell.openExternal("https://github.com/Levminer/authme/issues")

process.crash()
})

sentry.init({
dsn: "https://173234c94f8f4294a28e114c9113c1ce@o1020924.ingest.sentry.io/5986541",
release: `authme@${version}`,
})

// ? windows
let /** @type{BrowserWindow} */ window_splash
let /** @type{BrowserWindow} */ window_landing
Expand Down
Loading

0 comments on commit 232f7fc

Please sign in to comment.