MCPcopy
hub / github.com/Innei/Shiro / handleSubList

Function handleSubList

src/components/modules/subscribe/SubscribeModal.tsx:93–109  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

91 const query = useSubscribeStatusQuery()
92
93 const handleSubList: React.EventHandler<any> = async (e) => {
94 if (!canSub) {
95 toast.error('订阅功能暂时没有开启哦')
96 return
97 }
98 preventDefault(e)
99 const { email, types } = state
100 await apiClient.subscribe.subscribe(
101 email,
102 // @ts-ignore
103 Object.keys(types).filter((name) => state.types[name]) as any[],
104 )
105
106 toast.success('订阅成功,谢谢你!')
107 dispatch({ type: 'reset' })
108 onConfirm()
109 }
110 const title = useAggregationSelector((data) => data.seo.title)
111
112 return (

Callers

nothing calls this directly

Calls 3

preventDefaultFunction · 0.90
errorMethod · 0.80
successMethod · 0.80

Tested by

no test coverage detected