@echoxyz/sonar-react 0.4.1 → 0.4.2
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/CHANGELOG.md +6 -0
- package/dist/index.cjs +7 -6
- package/dist/index.js +7 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -147,6 +147,7 @@ function useSonarEntity(args) {
|
|
|
147
147
|
setState({
|
|
148
148
|
loading: false,
|
|
149
149
|
entity: resp.Entity,
|
|
150
|
+
walletAddress,
|
|
150
151
|
error: void 0,
|
|
151
152
|
hasFetched: true
|
|
152
153
|
});
|
|
@@ -155,13 +156,14 @@ function useSonarEntity(args) {
|
|
|
155
156
|
setState({
|
|
156
157
|
loading: false,
|
|
157
158
|
entity: void 0,
|
|
159
|
+
walletAddress: void 0,
|
|
158
160
|
error: void 0,
|
|
159
161
|
hasFetched: true
|
|
160
162
|
});
|
|
161
163
|
return;
|
|
162
164
|
}
|
|
163
165
|
const error = err instanceof Error ? err : new Error(String(err));
|
|
164
|
-
setState({ loading: false, entity: void 0, error, hasFetched: true });
|
|
166
|
+
setState({ loading: false, entity: void 0, walletAddress: void 0, error, hasFetched: true });
|
|
165
167
|
}
|
|
166
168
|
}, [client, saleUUID, walletAddress, fullyConnected]);
|
|
167
169
|
const reset = (0, import_react2.useCallback)(() => {
|
|
@@ -169,16 +171,15 @@ function useSonarEntity(args) {
|
|
|
169
171
|
loading: false,
|
|
170
172
|
hasFetched: false,
|
|
171
173
|
entity: void 0,
|
|
174
|
+
walletAddress: void 0,
|
|
172
175
|
error: void 0
|
|
173
176
|
});
|
|
174
177
|
}, []);
|
|
175
178
|
(0, import_react2.useEffect)(() => {
|
|
176
|
-
if (fullyConnected) {
|
|
177
|
-
|
|
178
|
-
refetch();
|
|
179
|
-
}
|
|
179
|
+
if (fullyConnected && state.walletAddress !== walletAddress) {
|
|
180
|
+
refetch();
|
|
180
181
|
}
|
|
181
|
-
}, [fullyConnected, state.
|
|
182
|
+
}, [fullyConnected, state.walletAddress, walletAddress, refetch]);
|
|
182
183
|
(0, import_react2.useEffect)(() => {
|
|
183
184
|
if (ready && (!authenticated || !walletAddress)) {
|
|
184
185
|
reset();
|
package/dist/index.js
CHANGED
|
@@ -118,6 +118,7 @@ function useSonarEntity(args) {
|
|
|
118
118
|
setState({
|
|
119
119
|
loading: false,
|
|
120
120
|
entity: resp.Entity,
|
|
121
|
+
walletAddress,
|
|
121
122
|
error: void 0,
|
|
122
123
|
hasFetched: true
|
|
123
124
|
});
|
|
@@ -126,13 +127,14 @@ function useSonarEntity(args) {
|
|
|
126
127
|
setState({
|
|
127
128
|
loading: false,
|
|
128
129
|
entity: void 0,
|
|
130
|
+
walletAddress: void 0,
|
|
129
131
|
error: void 0,
|
|
130
132
|
hasFetched: true
|
|
131
133
|
});
|
|
132
134
|
return;
|
|
133
135
|
}
|
|
134
136
|
const error = err instanceof Error ? err : new Error(String(err));
|
|
135
|
-
setState({ loading: false, entity: void 0, error, hasFetched: true });
|
|
137
|
+
setState({ loading: false, entity: void 0, walletAddress: void 0, error, hasFetched: true });
|
|
136
138
|
}
|
|
137
139
|
}, [client, saleUUID, walletAddress, fullyConnected]);
|
|
138
140
|
const reset = useCallback2(() => {
|
|
@@ -140,16 +142,15 @@ function useSonarEntity(args) {
|
|
|
140
142
|
loading: false,
|
|
141
143
|
hasFetched: false,
|
|
142
144
|
entity: void 0,
|
|
145
|
+
walletAddress: void 0,
|
|
143
146
|
error: void 0
|
|
144
147
|
});
|
|
145
148
|
}, []);
|
|
146
149
|
useEffect2(() => {
|
|
147
|
-
if (fullyConnected) {
|
|
148
|
-
|
|
149
|
-
refetch();
|
|
150
|
-
}
|
|
150
|
+
if (fullyConnected && state.walletAddress !== walletAddress) {
|
|
151
|
+
refetch();
|
|
151
152
|
}
|
|
152
|
-
}, [fullyConnected, state.
|
|
153
|
+
}, [fullyConnected, state.walletAddress, walletAddress, refetch]);
|
|
153
154
|
useEffect2(() => {
|
|
154
155
|
if (ready && (!authenticated || !walletAddress)) {
|
|
155
156
|
reset();
|