clear sessionID from URL after verification
This commit is contained in:
parent
23e86be77d
commit
75a89b1d6f
|
@ -199,7 +199,7 @@ export default function Gallery(props: Props) {
|
|||
setCollectionAndItsLatestFile(collectionAndItsLatestFile);
|
||||
const favItemIds = await getFavItemIds(data);
|
||||
setFavItemIds(favItemIds);
|
||||
await checkSubscriptionPurchase(setDialogMessage);
|
||||
await checkSubscriptionPurchase(setDialogMessage, router);
|
||||
await syncWithRemote();
|
||||
setIsFirstLoad(false);
|
||||
};
|
||||
|
|
|
@ -9,6 +9,7 @@ import billingService, {
|
|||
import { SUBSCRIPTION_VERIFICATION_ERROR } from './common/errorUtil';
|
||||
import { getData, LS_KEYS } from './storage/localStorage';
|
||||
import { MessageAttributes } from 'components/MessageDialog';
|
||||
import { NextRouter } from 'next/router';
|
||||
|
||||
export function convertBytesToGBs(bytes, precision?): string {
|
||||
return (bytes / (1024 * 1024 * 1024)).toFixed(precision ?? 2);
|
||||
|
@ -161,8 +162,10 @@ export async function updatePaymentMethod(event, setDialogMessage, setLoading) {
|
|||
}
|
||||
|
||||
export async function checkSubscriptionPurchase(
|
||||
setDialogMessage: React.Dispatch<React.SetStateAction<MessageAttributes>>
|
||||
setDialogMessage: React.Dispatch<React.SetStateAction<MessageAttributes>>,
|
||||
router: NextRouter
|
||||
) {
|
||||
try {
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const sessionId = urlParams.get('session_id');
|
||||
if (sessionId === '-1') {
|
||||
|
@ -189,4 +192,9 @@ export async function checkSubscriptionPurchase(
|
|||
});
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
//ignore
|
||||
} finally {
|
||||
router.push('gallery', undefined, { shallow: true });
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue