Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const handleCreateNewPrivateStory = async () => {
setLoadingCreate(true);
try {
const story = createNewEmptyStory();
if (storiesFile) {
storiesFile.stories.unshift(convertStoryToSubsetStory(story));
await saveStoriesFile(storiesFile);
await saveStoryFile(story);
Fathom.trackGoal(Goals.CREATE_NEW_STORY, 0);
router.push('/stories/[storyId]', `/stories/${story.id}`);
}
} catch (error) {
console.error(error);
toast.error(error.message);
setLoadingCreate(false);
}
};
const addAccount = async (account: Account) => {
if (!state.file) return;
Fathom.trackGoal(Goals.ADD_NEW_ACCOUNT, 0);
const file = state.file;
file.accounts.push(account);
await putFile(file);
dispatch({ type: 'success', file });
};
const handleLogin = () => {
Fathom.trackGoal(Goals.LOGIN, 0);
userSession.redirectToSignIn();
};
const handleLogin = () => {
Fathom.trackGoal(Goals.LOGIN, 0);
userSession.redirectToSignIn();
};
useEffect(() => {
if (config.fathomSiteId) {
Fathom.load();
Fathom.setSiteId(config.fathomSiteId);
Fathom.trackPageview();
}
}, []);
React.useEffect(() => {
if (process.env.NODE_ENV === 'production') {
Fathom.load();
Fathom.setSiteId('ONFMHEEY');
Fathom.trackPageview();
}
}, [])
return <span></span>
React.useEffect(() => {
if (process.env.NODE_ENV === 'production') {
Fathom.load();
Fathom.setSiteId('ONFMHEEY');
Fathom.trackPageview();
}
}, [])
return <span></span>
useEffect(() => {
if (config.fathomSiteId) {
Fathom.load();
Fathom.setSiteId(config.fathomSiteId);
Fathom.trackPageview();
}
}, []);
Router.events.on('routeChangeComplete', () => {
if (process.env.NODE_ENV === 'production') {
Fathom.trackPageview()
}
})
useEffect(() => {
if (config.fathomSiteId) {
Fathom.load();
Fathom.setSiteId(config.fathomSiteId);
Fathom.trackPageview();
}
}, []);