feat(tip): support tiered coffee gifts
This commit is contained in:
@@ -5,6 +5,7 @@ import { useRouter } from "next/navigation";
|
||||
|
||||
import {
|
||||
persistExternalEntryPayload,
|
||||
resolveExternalEntryDestination,
|
||||
resolveExternalEntryPromotionType,
|
||||
resolveExternalEntryTarget,
|
||||
shouldBindExternalFacebookIdentity,
|
||||
@@ -25,6 +26,7 @@ interface ExternalEntryPersistProps {
|
||||
psid: string | null;
|
||||
avatarUrl: string | null;
|
||||
target: string | null;
|
||||
coffeeType: string | null;
|
||||
mode: string | null;
|
||||
promotionType: string | null;
|
||||
}
|
||||
@@ -35,6 +37,7 @@ export default function ExternalEntryPersist({
|
||||
psid,
|
||||
avatarUrl,
|
||||
target,
|
||||
coffeeType,
|
||||
mode,
|
||||
promotionType,
|
||||
}: ExternalEntryPersistProps) {
|
||||
@@ -43,7 +46,8 @@ export default function ExternalEntryPersist({
|
||||
const authDispatch = useAuthDispatch();
|
||||
const [hasPersisted, setHasPersisted] = useState(false);
|
||||
const hasNavigatedRef = useRef(false);
|
||||
const destination = resolveExternalEntryTarget({ target });
|
||||
const targetRoute = resolveExternalEntryTarget({ target });
|
||||
const destination = resolveExternalEntryDestination({ target, coffeeType });
|
||||
const resolvedPromotionType = resolveExternalEntryPromotionType({
|
||||
mode,
|
||||
promotionType,
|
||||
@@ -60,7 +64,7 @@ export default function ExternalEntryPersist({
|
||||
psid,
|
||||
avatarUrl,
|
||||
}),
|
||||
destination === ROUTES.chat && resolvedPromotionType
|
||||
targetRoute === ROUTES.chat && resolvedPromotionType
|
||||
? savePendingChatPromotion(resolvedPromotionType)
|
||||
: clearPendingChatPromotion(),
|
||||
]);
|
||||
@@ -81,12 +85,14 @@ export default function ExternalEntryPersist({
|
||||
}, [
|
||||
avatarUrl,
|
||||
asid,
|
||||
coffeeType,
|
||||
destination,
|
||||
deviceId,
|
||||
mode,
|
||||
promotionType,
|
||||
psid,
|
||||
resolvedPromotionType,
|
||||
targetRoute,
|
||||
]);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user