diff options
author | 2024-01-26 08:24:20 +0530 | |
---|---|---|
committer | 2024-01-28 03:31:35 +0000 | |
commit | 6c67387b2978f1a02244a1350725238da35b341b (patch) | |
tree | c357ab6826cce8272642c01b0d80120bd5baaa86 /src/index.ts | |
parent | 6.7.1-nightly.11 [skip ci] (diff) | |
download | ferdium-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.ts | 19 |
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'; | |||
50 | import userAgent from './helpers/userAgent-helpers'; | 50 | import userAgent from './helpers/userAgent-helpers'; |
51 | import { translateTo } from './helpers/translation-helpers'; | 51 | import { translateTo } from './helpers/translation-helpers'; |
52 | import { darkThemeGrayDarkest } from './themes/legacy'; | 52 | import { darkThemeGrayDarkest } from './themes/legacy'; |
53 | import { readCerts, removeNewLines } from './helpers/certs-helpers'; | 53 | import { checkIfCertIsPresent } from './helpers/certs-helpers'; |
54 | 54 | ||
55 | const debug = require('./preload-safe-debug')('Ferdium:App'); | 55 | const 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 | ); |