@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.
- package/dist/cjs/index.cjs +7 -5
- package/dist/cjs/index.d.cts +1 -1
- package/dist/es/index.d.ts +1 -1
- package/dist/es/index.js +7 -5
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -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
|
-
|
|
615
|
-
|
|
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) {
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -96,7 +96,7 @@ type ContextProps = {
|
|
|
96
96
|
telegramLogin: () => void;
|
|
97
97
|
metaLogin: () => void;
|
|
98
98
|
coinbaseLogin: () => void;
|
|
99
|
-
getClaimrData
|
|
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.d.ts
CHANGED
|
@@ -96,7 +96,7 @@ type ContextProps = {
|
|
|
96
96
|
telegramLogin: () => void;
|
|
97
97
|
metaLogin: () => void;
|
|
98
98
|
coinbaseLogin: () => void;
|
|
99
|
-
getClaimrData
|
|
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
|
-
|
|
615
|
-
|
|
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) {
|