Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"snet-sdk-web": "5.0.4",
"utf8": "^3.0.0",
"validate.js": "^0.13.1",
"waf-captcha-frontend": "0.0.7",
"web3": "^4.11.1"
},
"resolutions": {
Expand Down Expand Up @@ -126,4 +127,4 @@
"ts-protoc-gen": "^0.15.0",
"url": "^0.11.4"
}
}
}
4 changes: 2 additions & 2 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"short_name": "SingularityNET AI Merketplace",
"name": "SingularityNET AI Merketplace",
"short_name": "SingularityNET AI Marketplace",
"name": "SingularityNET AI Marketplace",
"icons": [
{
"src": "favicon.ico",
Expand Down
2 changes: 1 addition & 1 deletion src/components/AiMarketplace/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import PromoComponent from "../PromoComponent";
import { Helmet } from "react-helmet";

const seoData = {
title: "SingularityNET AI Merketplace",
title: "SingularityNET AI Marketplace",
description: `The SingularityNET Marketplace hosts AI services. Services offer free calls to try before you use ${process.env.REACT_APP_TOKEN_NAME} or Paypal to purchase`,
image: `${process.env.REACT_APP_SNET_CDN}/dapp/assets/images/SEO/singularitynet-marketplace.png`,
twitterImage: `${process.env.REACT_APP_SNET_CDN}/dapp/assets/images/SEO/singularitynet-marketplace-twitter.png`,
Expand Down
2 changes: 1 addition & 1 deletion src/components/FeedbackFormModal/FeedbackForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ const FeedbackForm = ({ closeForm, sendFeedbackAPI }) => {
} catch (error) {
setAlert({ type: alertTypes.ERROR, message: error?.message });
} finally {
dispatch(loaderActions.stopAppLoader());
await new Promise((resolve) => setTimeout(resolve, 3000));
resetForm();
setIsRequestHandling(false);
dispatch(loaderActions.stopAppLoader());
closeForm();
}
};
Expand Down
1 change: 1 addition & 0 deletions src/components/FeedbackFormModal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const FeedbackForm = () => {

return (
<Fragment>
<div id="captchaContainer" />
<FeedbackFormModal
sendFeedbackAPI={sendFeedbackSnetAPI}
isModalVisible={isModalVisible}
Expand Down
2 changes: 1 addition & 1 deletion src/components/GetStarted/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { useStyles } from "./styles";
import SeoMetadata from "../common/SeoMetadata";

const seoData = {
title: "SingularityNET AI Merketplace",
title: "SingularityNET AI Marketplace",
description: `The SingularityNET Marketplace hosts AI services. Services offer free calls to try before you use ${process.env.REACT_APP_TOKEN_NAME} or Paypal to purchase`,
image: `${process.env.REACT_APP_SNET_CDN}/dapp/assets/images/SEO/singularitynet-marketplace.png`,
twitterImage: `${process.env.REACT_APP_SNET_CDN}/dapp/assets/images/SEO/singularitynet-marketplace-twitter.png`,
Expand Down
5 changes: 4 additions & 1 deletion src/config/SupportAPI.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import axios from "axios";
import { getCaptchaFetch } from "../utility/captchaFetch";

const source = "MARKETPLACE";

const captchaFetch = getCaptchaFetch();

export const sendFeedbackSnetAPI = async ({ name, email, category, feedback, attachmentUrls }) => {
const options = {
method: "POST",
Expand All @@ -26,7 +29,7 @@ export const sendFeedbackSnetAPI = async ({ name, email, category, feedback, att
if (!feedbackUrl) {
throw new Error("Cannot start the application! process.env.REACT_APP_FEEDBACK_ENDPOINT is undefined");
}
await fetch(feedbackUrl + "/user/message", options);
await captchaFetch(feedbackUrl + "/user/message", options);
};

const ENTER_CODE = "%0D%0A";
Expand Down
21 changes: 21 additions & 0 deletions src/utility/captchaFetch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { createCaptchaFetchHandler } from "waf-captcha-frontend";

export const getCaptchaFetch = () => {
const keys = {
JSAPI_URL: process.env.REACT_APP_JSAPI_URL,
CAPTCHA_TOKEN: process.env.REACT_APP_CAPTCHA_TOKEN,
};

if (!keys.CAPTCHA_TOKEN || !keys.JSAPI_URL) {
console.warn("Captcha configuration is not provided");
return fetch;
}

const captchaFetch = createCaptchaFetchHandler({
API_KEY: keys.CAPTCHA_TOKEN,
JSAPI_URL: keys.JSAPI_URL,
captchaContainerId: "captchaContainer",
});

return captchaFetch;
};
Loading