MCPcopy Create free account
hub / github.com/dailydotdev/apps / onSubmitFeed

Function onSubmitFeed

packages/shared/src/components/modals/NewSourceModal.tsx:204–220  ·  view source on GitHub ↗
(
    e: React.FormEvent<HTMLFormElement>,
  )

Source from the content-addressed store, hash-verified

202 await scrapeSource(data.url);
203 };
204 const onSubmitFeed = async (
205 e: React.FormEvent<HTMLFormElement>,
206 ): Promise<void> => {
207 e.preventDefault();
208
209 if (existingSource) {
210 return;
211 }
212
213 const data = formToJson<{ rss: string }>(e.currentTarget);
214 const res = await checkIfSourceExists(data.rss);
215 if (res.source) {
216 setExistingSource(res.source);
217 } else {
218 await requestSource(data.rss);
219 }
220 };
221
222 const onNotificationClose = async (e: React.MouseEvent) => {
223 await setIsDismissed(true);

Callers

nothing calls this directly

Calls 1

formToJsonFunction · 0.90

Tested by

no test coverage detected