Commit 8e81da7c authored by hewenhao's avatar hewenhao

feat: update

parent 0c073857
......@@ -48,18 +48,27 @@ const Group = () => {
const getGroupNo = useCallback(() => {
const { noun, adj } = dataRef.current
const nam = `${randomPick(adj)}${randomPick(noun)}`
const nam = [randomPick(adj), randomPick(noun)].filter(Boolean).join('')
setGroupNo(nam)
}, [])
useEffect(() => {
const fn = async () => {
const words = await getNickNameWords('words')
dataRef.current = words
const getWords = useCallback(async () => {
const words = await getNickNameWords('words')
dataRef.current = words
getGroupNo()
}, [getGroupNo])
const _genGroundNo = useCallback(() => {
if (dataRef.current.adj.length < 1) {
getWords()
} else {
getGroupNo()
}
fn()
}, [getGroupNo])
}, [getGroupNo, getWords])
useEffect(() => {
getWords()
}, [getWords])
useDidShow(async () => {
const tabbar = getTabBar<TabbarRef>(page)
......@@ -137,7 +146,7 @@ const Group = () => {
<Modal isVisible={isVisible} tilte="学习部落名" onClose={setFalse}>
<View className={styles.modal}>
<View className={styles.modal_body} onClick={getGroupNo}>
<View className={styles.modal_body} onClick={_genGroundNo}>
<Input className={styles.modal_input} disabled value={groupNo} />
<Image className={styles.modal_refresh} mode="widthFix" src={assets['refresh.png'].u} />
</View>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment