@b3dotfun/sdk 0.0.64-alpha.1 → 0.0.64
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.
|
@@ -44,6 +44,17 @@ function useAuthentication(partnerId) {
|
|
|
44
44
|
const activeWagmiAccount = (0, wagmi_1.useAccount)();
|
|
45
45
|
const { switchAccount } = (0, wagmi_1.useSwitchAccount)();
|
|
46
46
|
debug("@@activeWagmiAccount", activeWagmiAccount);
|
|
47
|
+
// Check localStorage version and clear if not found or mismatched
|
|
48
|
+
(0, react_2.useEffect)(() => {
|
|
49
|
+
if (typeof localStorage !== "undefined") {
|
|
50
|
+
const version = localStorage.getItem("version");
|
|
51
|
+
if (version !== "1") {
|
|
52
|
+
debug("@@localStorage:clearing due to version mismatch", { version });
|
|
53
|
+
localStorage.clear();
|
|
54
|
+
localStorage.setItem("version", "1");
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}, []);
|
|
47
58
|
const wallet = (0, wallets_1.ecosystemWallet)(constants_1.ecosystemWalletId, {
|
|
48
59
|
partnerId: partnerId,
|
|
49
60
|
});
|
|
@@ -38,6 +38,17 @@ export function useAuthentication(partnerId) {
|
|
|
38
38
|
const activeWagmiAccount = useAccount();
|
|
39
39
|
const { switchAccount } = useSwitchAccount();
|
|
40
40
|
debug("@@activeWagmiAccount", activeWagmiAccount);
|
|
41
|
+
// Check localStorage version and clear if not found or mismatched
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
if (typeof localStorage !== "undefined") {
|
|
44
|
+
const version = localStorage.getItem("version");
|
|
45
|
+
if (version !== "1") {
|
|
46
|
+
debug("@@localStorage:clearing due to version mismatch", { version });
|
|
47
|
+
localStorage.clear();
|
|
48
|
+
localStorage.setItem("version", "1");
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}, []);
|
|
41
52
|
const wallet = ecosystemWallet(ecosystemWalletId, {
|
|
42
53
|
partnerId: partnerId,
|
|
43
54
|
});
|
package/package.json
CHANGED
|
@@ -48,6 +48,18 @@ export function useAuthentication(partnerId: string) {
|
|
|
48
48
|
const { switchAccount } = useSwitchAccount();
|
|
49
49
|
debug("@@activeWagmiAccount", activeWagmiAccount);
|
|
50
50
|
|
|
51
|
+
// Check localStorage version and clear if not found or mismatched
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (typeof localStorage !== "undefined") {
|
|
54
|
+
const version = localStorage.getItem("version");
|
|
55
|
+
if (version !== "1") {
|
|
56
|
+
debug("@@localStorage:clearing due to version mismatch", { version });
|
|
57
|
+
localStorage.clear();
|
|
58
|
+
localStorage.setItem("version", "1");
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}, []);
|
|
62
|
+
|
|
51
63
|
const wallet = ecosystemWallet(ecosystemWalletId, {
|
|
52
64
|
partnerId: partnerId,
|
|
53
65
|
});
|