aboutsummaryrefslogtreecommitdiffstats
path: root/src/index.ts
diff options
context:
space:
mode:
authorLibravatar Vijay A <vraravam@users.noreply.github.com>2024-01-26 08:24:20 +0530
committerLibravatar Vijay Aravamudhan <vraravam@users.noreply.github.com>2024-01-28 03:31:35 +0000
commit6c67387b2978f1a02244a1350725238da35b341b (patch)
treec357ab6826cce8272642c01b0d80120bd5baaa86 /src/index.ts
parent6.7.1-nightly.11 [skip ci] (diff)
downloadferdium-app-6c67387b2978f1a02244a1350725238da35b341b.tar.gz
ferdium-app-6c67387b2978f1a02244a1350725238da35b341b.tar.zst
ferdium-app-6c67387b2978f1a02244a1350725238da35b341b.zip
chore: minor refactoring to reduce lines and add tests
Diffstat (limited to 'src/index.ts')
-rw-r--r--src/index.ts19
1 files changed, 2 insertions, 17 deletions
diff --git a/src/index.ts b/src/index.ts
index 8419d5cf9..fe254b4f6 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -50,7 +50,7 @@ import { openExternalUrl } from './helpers/url-helpers';
50import userAgent from './helpers/userAgent-helpers'; 50import userAgent from './helpers/userAgent-helpers';
51import { translateTo } from './helpers/translation-helpers'; 51import { translateTo } from './helpers/translation-helpers';
52import { darkThemeGrayDarkest } from './themes/legacy'; 52import { darkThemeGrayDarkest } from './themes/legacy';
53import { readCerts, removeNewLines } from './helpers/certs-helpers'; 53import { checkIfCertIsPresent } from './helpers/certs-helpers';
54 54
55const debug = require('./preload-safe-debug')('Ferdium:App'); 55const debug = require('./preload-safe-debug')('Ferdium:App');
56 56
@@ -773,21 +773,6 @@ app.on(
773 return; 773 return;
774 } 774 }
775 775
776 const trustedCerts = readCerts(); 776 callback(checkIfCertIsPresent(certificate.data));
777 if (!trustedCerts) {
778 callback(false);
779 return;
780 }
781
782 const isTrustedCert = trustedCerts.includes(
783 removeNewLines(certificate.data),
784 );
785
786 if (isTrustedCert) {
787 callback(true);
788 return;
789 }
790
791 callback(false);
792 }, 777 },
793); 778);