Refactor UsageChart and UsageStats components to support dynamic period selection

This commit is contained in:
decolua
2026-03-03 16:19:44 +07:00
parent 11b2fcd643
commit 7195fee2f6
5 changed files with 116 additions and 59 deletions
+4 -3
View File
@@ -26,9 +26,10 @@ async function checkCertInstalled(certPath) {
function checkCertInstalledMac(certPath) {
return new Promise((resolve) => {
try {
const fingerprint = getCertFingerprint(certPath);
exec(`security find-certificate -a -Z /Library/Keychains/System.keychain | grep -i "${fingerprint}"`, (error) => {
resolve(!error);
// security outputs fingerprint without colons (e.g. "078B6B5F..."), strip them before grep
const fingerprint = getCertFingerprint(certPath).replace(/:/g, "");
exec(`security find-certificate -a -Z /Library/Keychains/System.keychain | grep -i "${fingerprint}"`, (error, stdout) => {
resolve(!error && !!stdout?.trim());
});
} catch {
resolve(false);