feat(家庭健康): 优化家庭组加入流程,移除自动创建家庭组逻辑

This commit is contained in:
richarjiang
2025-12-04 19:10:05 +08:00
parent a254af92c7
commit f3d4264b53
5 changed files with 193 additions and 62 deletions

View File

@@ -1,7 +1,6 @@
import { HeaderBar } from '@/components/ui/HeaderBar';
import { useAppDispatch, useAppSelector } from '@/hooks/redux';
import {
createFamilyGroup,
fetchFamilyGroup,
generateInviteCode,
selectFamilyGroup,
@@ -13,16 +12,16 @@ import { Ionicons } from '@expo/vector-icons';
import { LinearGradient } from 'expo-linear-gradient';
import { Stack } from 'expo-router';
import React, { useEffect, useState } from 'react';
import {
ActivityIndicator,
Alert,
Modal,
ScrollView,
Share,
StyleSheet,
Text,
TouchableOpacity,
View
import {
ActivityIndicator,
Alert,
Modal,
ScrollView,
Share,
StyleSheet,
Text,
TouchableOpacity,
View
} from 'react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
@@ -47,11 +46,6 @@ export default function FamilyInviteScreen() {
// 处理邀请按钮点击
const handleInvite = async () => {
try {
// 如果没有家庭组,先创建一个
if (!familyGroup) {
await dispatch(createFamilyGroup('我的家庭')).unwrap();
}
// 生成邀请码
await dispatch(generateInviteCode(24)).unwrap();