π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Validate that getPath is not throwing
Manav Rathi68fe6f45c415
diff --git a/desktop/src/main.ts b/desktop/src/main.tsindex e8a21c6437..7ec899ec72 100644--- a/desktop/src/main.ts+++ b/desktop/src/main.ts@@ -110,9 +110,16 @@ const increaseDiskCache = () => {* versions.*/const deleteLegacyDiskCacheDirIfExists = async () => {- // The existing code was passing "cache" as a parameter to getPath. This was- // incorrect, cache is not a valid value. However, we replicate that- // behaviour so that we get back the same path that the old got was getting.+ // The existing code was passing "cache" as a parameter to getPath. This is+ // incorrect if we go by the types - "cache" is not a valid value for the+ // parameter to `app.getPath`.+ //+ // It might be an issue in the types, since at runtime it seems to work. For+ // example, on macOS I get `~/Library/Caches`.+ //+ // Irrespective, we replicate the original behaviour so that we get back the+ // same path that the old got was getting.+ //// @ts-expect-errorconst cacheDir = path.join(app.getPath("cache"), "ente");if (existsSync(cacheDir)) {