π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
fix(photos):ignore-subscription-request-after-account-closes
Aswin Asoka2d4f1e1d938
diff --git a/web/apps/photos/src/components/sidebar/accounts/Account.tsx b/web/apps/photos/src/components/sidebar/accounts/Account.tsxindex 85ff1ea553..313078d402 100644--- a/web/apps/photos/src/components/sidebar/accounts/Account.tsx+++ b/web/apps/photos/src/components/sidebar/accounts/Account.tsx@@ -35,7 +35,13 @@ import {} from "ente-new/photos/services/user-details";import { t } from "i18next";import { useRouter } from "next/router";-import React, { useCallback, useEffect, useMemo, useState } from "react";+import React, {+ useCallback,+ useEffect,+ useMemo,+ useRef,+ useState,+} from "react";import { DeleteAccount } from "../account/DeleteAccount";import { SessionsSettings } from "../account/SessionsSettings";import { ManageMemberSubscription } from "./ManageMemberSubscription";@@ -75,6 +81,14 @@ export const Account: React.FC<AccountProps> = ({const [twoFactorEnabled, setTwoFactorEnabled] = useState<boolean>();const [disablingTwoFactor, setDisablingTwoFactor] = useState(false);const [sessionCount, setSessionCount] = useState<number>();+ const subscriptionRequest = useRef(0);++ useEffect(+ () => () => {+ subscriptionRequest.current += 1;+ },+ [open],+ );let planSubtext: string | undefined;if (userDetails) {@@ -157,11 +171,13 @@ export const Account: React.FC<AccountProps> = ({}, [router]);const handleManageSubscription = useCallback(() => {+ const requestID = ++subscriptionRequest.current;void (async () => {if (!userDetails) {await pullUserDetails();}+ if (subscriptionRequest.current != requestID) return;const resolvedUserDetails = userDetails ?? userDetailsSnapshot();if (!resolvedUserDetails) return;