@redzone/taunt-logins-ui-react 0.0.14 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -552,7 +552,9 @@ function ModalView({ title, content, onClose }) {
552
552
 
553
553
  const TauntProvider = ({ children, tauntServiceEndpoint, magicKey })=>{
554
554
  const [deets, setDeets] = react.useState();
555
- const taunt = new tauntLogins.TauntApi(tauntServiceEndpoint);
555
+ const taunt = react.useMemo(()=>new tauntLogins.TauntApi(tauntServiceEndpoint), [
556
+ tauntServiceEndpoint
557
+ ]);
556
558
  const [isLoading, setIsLoading] = react.useState(false);
557
559
  const loggedIn = !!deets;
558
560
  const otpMagicLogin = react.useCallback((email)=>{
@@ -610,10 +612,10 @@ const TauntProvider = ({ children, tauntServiceEndpoint, magicKey })=>{
610
612
  setIsLoading(false);
611
613
  }
612
614
  })(), []);
613
- const getClaimrData = react.useCallback(()=>{
614
- if (!loggedIn) return undefined;
615
- return taunt.getClaimrData();
616
- }, [
615
+ const getClaimrData = react.useCallback(()=>cc._async_to_generator(function*() {
616
+ if (!loggedIn) return undefined;
617
+ return taunt.getClaimrData();
618
+ })(), [
617
619
  loggedIn
618
620
  ]);
619
621
  if (!tauntServiceEndpoint) {
@@ -96,7 +96,7 @@ type ContextProps = {
96
96
  telegramLogin: () => void;
97
97
  metaLogin: () => void;
98
98
  coinbaseLogin: () => void;
99
- getClaimrData?: () => Promise<ClaimrCampaignData | undefined>;
99
+ getClaimrData: () => Promise<ClaimrCampaignData | undefined>;
100
100
  getClaimrToken: () => Promise<string | undefined>;
101
101
  refreshToken: (token: string) => Promise<void>;
102
102
  logout: () => void;
@@ -96,7 +96,7 @@ type ContextProps = {
96
96
  telegramLogin: () => void;
97
97
  metaLogin: () => void;
98
98
  coinbaseLogin: () => void;
99
- getClaimrData?: () => Promise<ClaimrCampaignData | undefined>;
99
+ getClaimrData: () => Promise<ClaimrCampaignData | undefined>;
100
100
  getClaimrToken: () => Promise<string | undefined>;
101
101
  refreshToken: (token: string) => Promise<void>;
102
102
  logout: () => void;
package/dist/es/index.js CHANGED
@@ -552,7 +552,9 @@ function ModalView({ title, content, onClose }) {
552
552
 
553
553
  const TauntProvider = ({ children, tauntServiceEndpoint, magicKey })=>{
554
554
  const [deets, setDeets] = useState();
555
- const taunt = new TauntApi(tauntServiceEndpoint);
555
+ const taunt = useMemo(()=>new TauntApi(tauntServiceEndpoint), [
556
+ tauntServiceEndpoint
557
+ ]);
556
558
  const [isLoading, setIsLoading] = useState(false);
557
559
  const loggedIn = !!deets;
558
560
  const otpMagicLogin = useCallback((email)=>{
@@ -610,10 +612,10 @@ const TauntProvider = ({ children, tauntServiceEndpoint, magicKey })=>{
610
612
  setIsLoading(false);
611
613
  }
612
614
  })(), []);
613
- const getClaimrData = useCallback(()=>{
614
- if (!loggedIn) return undefined;
615
- return taunt.getClaimrData();
616
- }, [
615
+ const getClaimrData = useCallback(()=>_async_to_generator(function*() {
616
+ if (!loggedIn) return undefined;
617
+ return taunt.getClaimrData();
618
+ })(), [
617
619
  loggedIn
618
620
  ]);
619
621
  if (!tauntServiceEndpoint) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redzone/taunt-logins-ui-react",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
4
4
  "type": "module",
5
5
  "main": "./dist/es/index.js",
6
6
  "module": "./dist/es/index.js",