@rpcbase/client 0.55.0 → 0.56.0
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/auth/SignUp/index.js +5 -2
- package/package.json +1 -1
- package/rts/index.js +5 -1
package/auth/SignUp/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import page from "page"
|
|
|
4
4
|
|
|
5
5
|
import {reconnect as rts_reconnect} from "../../rts"
|
|
6
6
|
|
|
7
|
-
import {set_is_signed_in, set_uid} from "../index"
|
|
7
|
+
import {set_is_signed_in, set_uid, set_tenant_id} from "../index"
|
|
8
8
|
import post from "../../helpers/post"
|
|
9
9
|
import Footer from "../Footer"
|
|
10
10
|
|
|
@@ -28,8 +28,11 @@ const SignUp = ({
|
|
|
28
28
|
return
|
|
29
29
|
}
|
|
30
30
|
const res = await post("/api/v1/auth/sign_up", {email, password})
|
|
31
|
+
|
|
31
32
|
if (res.status === "ok") {
|
|
32
|
-
|
|
33
|
+
const {user_id} = res
|
|
34
|
+
set_uid(user_id)
|
|
35
|
+
set_tenant_id(user_id.slice(0, 8))
|
|
33
36
|
set_is_signed_in(true)
|
|
34
37
|
|
|
35
38
|
// we must now reconnect on the websocket as we now have a new cookie
|
package/package.json
CHANGED
package/rts/index.js
CHANGED
|
@@ -141,7 +141,11 @@ export const connect = () => new Promise((resolve) => {
|
|
|
141
141
|
|
|
142
142
|
export const disconnect = () => {
|
|
143
143
|
if (_socket) {
|
|
144
|
-
|
|
144
|
+
try {
|
|
145
|
+
_socket.disconnect()
|
|
146
|
+
} catch (e) {
|
|
147
|
+
// TODO: should we be swallowing this error
|
|
148
|
+
}
|
|
145
149
|
_socket = null
|
|
146
150
|
}
|
|
147
151
|
}
|