From cebe95acf51177417f6879a45060a10e371e7f59 Mon Sep 17 00:00:00 2001
From: Savely Savianok <1986developer@gmail.com>
Date: Wed, 26 Feb 2025 00:21:30 +0300
Subject: [PATCH] refactor: removed useless logs

---
 app-side/index.js                | 12 ++++--------
 lib/totp-quickjs/OTPGenerator.js |  1 -
 page/index.js                    |  2 --
 page/render/index/renderer.js    |  1 -
 setting/index.js                 |  3 ---
 5 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/app-side/index.js b/app-side/index.js
index 1932ed6..b1cc4bf 100644
--- a/app-side/index.js
+++ b/app-side/index.js
@@ -6,16 +6,12 @@ AppSideService(
       onInit(){
 
       },
-      onRequest(req, res){
-        if(req.method === 'totps'){
-          console.log(req)
-          console.log(`sending response: ${settings.settingsStorage.getItem('TOTPs')}`)
-          res(null, settings.settingsStorage.getItem('TOTPs'))
+      onRequest(request, response){
+        if(request.method === 'totps'){
+          response(null, settings.settingsStorage.getItem('TOTPs'))
         }
       },
-      onSettingsChange(set){
-        console.log(set)
-      }
+      onSettingsChange(){ }
     }
   )
 )
\ No newline at end of file
diff --git a/lib/totp-quickjs/OTPGenerator.js b/lib/totp-quickjs/OTPGenerator.js
index c06d42a..cbf9a29 100644
--- a/lib/totp-quickjs/OTPGenerator.js
+++ b/lib/totp-quickjs/OTPGenerator.js
@@ -16,7 +16,6 @@ export function getHOTP(counter, secret, digits = 6, hashType = 'SHA-1'){
     rawDataCounter.setUint32(4, counter)
     
     const bCounter = new Uint8Array(rawDataCounter.buffer)
-    console.log(bCounter)
     const bSecret = new Uint8Array(decode(secret).match(/.{1,2}/g).map(chunk => parseInt(chunk, 16))); //confirmed
     
     //Stage 2: Hash data
diff --git a/page/index.js b/page/index.js
index 94b04a0..43ceff0 100644
--- a/page/index.js
+++ b/page/index.js
@@ -8,12 +8,10 @@ Page(
 	BasePage({
 		onInit() {
 			this.getTOTPData().then((x) => {
-				console.log(x)
 				app._options.globalData.TOTPS = JSON.parse(x) ?? []
 				this.initPage()
 			})
 			.catch((x) => {
-				console.log(x)
 			 	app._options.globalData.TOTPS = []
 				this.initPage()
 			 })
diff --git a/page/render/index/renderer.js b/page/render/index/renderer.js
index a741f29..b0e40b3 100644
--- a/page/render/index/renderer.js
+++ b/page/render/index/renderer.js
@@ -21,7 +21,6 @@ const renderData = []
 function renderTOTPs(buffer) {
     for (let i = 0; i < buffer.length; i++) {
         let otpData = TOTP.copy(buffer[i]).getOTP()
-        console.log(otpData.otp)
         renderData[i] = {
             OTP: RenderOTPValue(i, otpData.otp),
             expireBar: RenderExpireBar(i, otpData.createdTime, buffer[i].fetchTime)
diff --git a/setting/index.js b/setting/index.js
index 683dad8..579ac75 100644
--- a/setting/index.js
+++ b/setting/index.js
@@ -6,7 +6,6 @@ AppSettingsPage({
   build(props) {
     _props = props;
 
-    console.log(props.settingsStorage.getItem("TOTPs"))
     const storage = JSON.parse(props.settingsStorage.getItem("TOTPs") ?? "[]")
     const totpEntrys = GetTOTPList(storage)
     const createButton = TextInput({
@@ -159,7 +158,5 @@ function GetTOTPList(storage){
 }
 
 function updateStorage(storage){
-  console.log("new storage is:")
-  console.log(storage)
   _props.settingsStorage.setItem('TOTPs', JSON.stringify(storage))
 }
\ No newline at end of file