@go-avro/avro-js 0.0.2-beta.146 → 0.0.2-beta.148

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.
@@ -220,12 +220,17 @@ export class AvroQueryClient {
220
220
  const queryClient = this.getQueryClient();
221
221
  return useMutation({
222
222
  mutationFn: async (cancelToken) => {
223
- this.setAuthState(AuthState.UNAUTHENTICATED);
224
- await this.post('/logout', null, cancelToken);
225
- await this.config.authManager.clearCache();
226
- if (this.socket && this.socket.connected) {
227
- this.socket.disconnect();
228
- }
223
+ return new Promise((resolve) => {
224
+ this.post('/logout', null, cancelToken).then(() => {
225
+ this.config.authManager.clearCache().then(() => {
226
+ if (this.socket && this.socket.connected) {
227
+ this.socket.disconnect();
228
+ }
229
+ this.setAuthState(AuthState.UNAUTHENTICATED);
230
+ resolve();
231
+ });
232
+ });
233
+ });
229
234
  },
230
235
  onSettled: () => {
231
236
  queryClient.invalidateQueries();
@@ -1,5 +1,5 @@
1
- import { AvroQueryClient } from "../../client/QueryClient";
2
1
  import { useMutation, useQuery } from "@tanstack/react-query";
2
+ import { AvroQueryClient } from "../../client/QueryClient";
3
3
  AvroQueryClient.prototype.useCreateProposal = function () {
4
4
  return useMutation({
5
5
  mutationFn: async ({ job_id, data }) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@go-avro/avro-js",
3
- "version": "0.0.2-beta.146",
3
+ "version": "0.0.2-beta.148",
4
4
  "description": "JS client for Avro backend integration.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",