π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Sugar
Manav Rathicf424e59f675
diff --git a/web/apps/photos/src/components/FileList.tsx b/web/apps/photos/src/components/FileList.tsxindex 20de949231..54daf7a82d 100644--- a/web/apps/photos/src/components/FileList.tsx+++ b/web/apps/photos/src/components/FileList.tsx@@ -1235,7 +1235,7 @@ const FileThumbnail: React.FC<FileThumbnailProps> = ({onClick={handleClick}onMouseEnter={handleHover}disabled={!imageURL}- {...(selectable ? longPressHandlers : {})}+ {...(selectable && longPressHandlers)}>{selectable && (<Checkdiff --git a/web/apps/photos/src/components/FixCreationTime.tsx b/web/apps/photos/src/components/FixCreationTime.tsxindex 396ecef737..03b3faf050 100644--- a/web/apps/photos/src/components/FixCreationTime.tsx+++ b/web/apps/photos/src/components/FixCreationTime.tsx@@ -89,7 +89,7 @@ export const FixCreationTime: React.FC<FixCreationTimeProps> = ({pt: "6px",display: "flex",flexDirection: "column",- ...(step == "running" ? { alignItems: "center" } : {}),+ ...(step == "running" && { alignItems: "center" }),}}>{message && <Typography>{message}</Typography>}diff --git a/web/packages/accounts/services/user.ts b/web/packages/accounts/services/user.tsindex 66b03e2ac4..398eec1372 100644--- a/web/packages/accounts/services/user.ts+++ b/web/packages/accounts/services/user.ts@@ -651,7 +651,7 @@ export const verifyEmail = async (const res = await fetch(await apiURL("/users/verify-email"), {method: "POST",headers: publicRequestHeaders(),- body: JSON.stringify({ email, ott, ...(source ? { source } : {}) }),+ body: JSON.stringify({ email, ott, ...(source && { source }) }),});ensureOk(res);return RemoteEmailOrSRPVerificationResponse.parse(await res.json());diff --git a/web/packages/base/components/OverflowMenu.tsx b/web/packages/base/components/OverflowMenu.tsxindex daadf700e8..7f42564c22 100644--- a/web/packages/base/components/OverflowMenu.tsx+++ b/web/packages/base/components/OverflowMenu.tsx@@ -71,7 +71,7 @@ export const OverflowMenu: React.FC<</IconButton><Menuid={ariaID}- {...(anchorEl ? { anchorEl } : {})}+ {...(anchorEl && { anchorEl })}open={!!anchorEl}onClose={() => setAnchorEl(undefined)}slotProps={{diff --git a/web/packages/base/http.ts b/web/packages/base/http.tsindex 8dd9b76d09..d926037445 100644--- a/web/packages/base/http.ts+++ b/web/packages/base/http.ts@@ -15,7 +15,7 @@ import { ensureAuthToken } from "./token";export const authenticatedRequestHeaders = async () => ({"X-Auth-Token": await ensureAuthToken(),"X-Client-Package": clientPackageName,- ...(isDesktop ? { "X-Client-Version": desktopAppVersion } : {}),+ ...(isDesktop && { "X-Client-Version": desktopAppVersion }),});/**@@ -27,7 +27,7 @@ export const authenticatedRequestHeaders = async () => ({*/export const publicRequestHeaders = () => ({"X-Client-Package": clientPackageName,- ...(isDesktop ? { "X-Client-Version": desktopAppVersion } : {}),+ ...(isDesktop && { "X-Client-Version": desktopAppVersion }),});/**@@ -87,7 +87,7 @@ export class HTTPError extends Error {super(`HTTP ${res.status} ${res.statusText} (${url.pathname})`);const requestID = res.headers.get("x-request-id");- const details = { url: url.href, ...(requestID ? { requestID } : {}) };+ const details = { url: url.href, ...(requestID && { requestID }) };// Cargo culted from// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#custom_error_typesdiff --git a/web/packages/base/next.config.base.js b/web/packages/base/next.config.base.jsindex 8afb699564..9a69464580 100644--- a/web/packages/base/next.config.base.js+++ b/web/packages/base/next.config.base.js@@ -116,9 +116,8 @@ const nextConfig = {// Ask Next to use a separate dist directory for the desktop during// development. This allows us run dev servers simultaneously for both web// and desktop code without them stepping on each others toes.- ...(process.env.NODE_ENV != "production" && isDesktop- ? { distDir: ".next-desktop" }- : {}),+ ...(process.env.NODE_ENV != "production" &&+ isDesktop && { distDir: ".next-desktop" }),// Customize the webpack configuration used by Next.js.webpack: (config, { isServer }) => {diff --git a/web/packages/gallery/components/FileInfo.tsx b/web/packages/gallery/components/FileInfo.tsxindex b6f1cc54f6..62e169aca4 100644--- a/web/packages/gallery/components/FileInfo.tsx+++ b/web/packages/gallery/components/FileInfo.tsx@@ -517,9 +517,7 @@ const InfoItem: React.FC<React.PropsWithChildren<InfoItemProps>> = ({<Typography sx={{ wordBreak: "break-all" }}>{title}</Typography><Typographyvariant="small"- {...(typeof caption == "string"- ? {}- : { component: "div" })}+ {...(typeof caption != "string" && { component: "div" })}sx={{ color: "text.muted" }}>{caption}diff --git a/web/packages/gallery/components/utils/use-file-input.ts b/web/packages/gallery/components/utils/use-file-input.tsindex 44e923af22..7aec8d3d6e 100644--- a/web/packages/gallery/components/utils/use-file-input.ts+++ b/web/packages/gallery/components/utils/use-file-input.ts@@ -115,7 +115,7 @@ export const useFileInput = ({...directoryOpts,ref: inputRef,onChange: handleChange,- ...(accept ? { accept } : {}),+ ...(accept && { accept }),}),[directoryOpts, accept, handleChange],);diff --git a/web/packages/gallery/services/download.ts b/web/packages/gallery/services/download.tsindex b847b26326..20f8281b6e 100644--- a/web/packages/gallery/services/download.ts+++ b/web/packages/gallery/services/download.ts@@ -787,7 +787,7 @@ const publicAlbums_downloadThumbnail = async (const { accessToken, accessTokenJWT } = credentials;const params = new URLSearchParams({accessToken,- ...(accessTokenJWT ? { accessTokenJWT } : {}),+ ...(accessTokenJWT && { accessTokenJWT }),});return fetch(`${customOrigin}/public-collection/files/preview/${file.id}?${params.toString()}`,@@ -820,7 +820,7 @@ const publicAlbums_downloadFile = async (const { accessToken, accessTokenJWT } = credentials;const params = new URLSearchParams({accessToken,- ...(accessTokenJWT ? { accessTokenJWT } : {}),+ ...(accessTokenJWT && { accessTokenJWT }),});return fetch(`${customOrigin}/public-collection/files/download/${file.id}?${params.toString()}`,diff --git a/web/packages/new/photos/services/collection.ts b/web/packages/new/photos/services/collection.tsindex 4be4b1f1ce..f2d591c0f8 100644--- a/web/packages/new/photos/services/collection.ts+++ b/web/packages/new/photos/services/collection.ts@@ -135,7 +135,7 @@ export const createCollection2 = async (encryptedName,nameDecryptionNonce,type,- ...(magicMetadata ? { magicMetadata } : {}),+ ...(magicMetadata && { magicMetadata }),});return decryptRemoteCollection(