This commit is contained in:
chashaobao
2025-12-29 23:49:51 +08:00
parent 23879fe88d
commit c586e4b227
5 changed files with 41 additions and 12 deletions

View File

@ -2,7 +2,7 @@ import { Button, Image } from '@tarojs/components';
import Taro from '@tarojs/taro';
import { Arrow } from '@taroify/icons';
import { Fragment, useCallback, useEffect, useState } from 'react';
import { Fragment, useCallback, useEffect, useRef, useState } from 'react';
import { EventName, OpenSource, PageUrl } from '@/constants/app';
import { CITY_CODE_TO_NAME_MAP } from '@/constants/city';
@ -46,6 +46,15 @@ export default function InviteOperations() {
};
}, [handleCityChange]);
const useCopyRef = useRef(false);
useEffect(() => {
if (!userInfo.userId) return;
if (useCopyRef.current) return;
handleCopy();
useCopyRef.current = true;
}, [handleCopy, userInfo.userId]);
useEffect(() => {
if (!cityCode) return;