@rpcbase/client 0.87.0 → 0.88.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.
@@ -5,9 +5,10 @@ import {ActivityIndicator} from "react-native"
5
5
  import Alert from "react-bootstrap/Alert"
6
6
  import page from "page"
7
7
 
8
+ import {sign_out} from "../sign_out"
9
+
8
10
  import post from "../../helpers/post"
9
11
 
10
- import {set_is_signed_in, set_uid} from "../index"
11
12
  import AccountListItem from "../AccountsList/AccountListItem"
12
13
  import Footer from "../Footer"
13
14
 
@@ -42,11 +43,7 @@ const SignOut = ({
42
43
  const signOut = async() => {
43
44
  const res = await post("/api/v1/auth/sign_out")
44
45
  if (res.status === "ok") {
45
- set_uid(null)
46
- set_is_signed_in(false)
47
- localStorage.clear()
48
-
49
- // TODO: clear DB
46
+ sign_out()
50
47
  setIsSignedOut(true)
51
48
  onSuccess()
52
49
  } else {
@@ -56,8 +53,8 @@ const SignOut = ({
56
53
 
57
54
 
58
55
  const onSubmit = () => {
56
+ console.log("sign out from selected accounts", selectedAccounts)
59
57
  signOut()
60
- console.log("SEL", selectedAccounts)
61
58
  }
62
59
 
63
60
  return (
package/auth/index.js CHANGED
@@ -115,3 +115,5 @@ export const set_tenant_id = (val) => __tenant_id = val
115
115
  export const set_is_signed_in = (val) => __is_authenticated = val
116
116
 
117
117
  export const is_signed_in = () => __is_authenticated
118
+
119
+ export * from "./sign_out"
@@ -0,0 +1,12 @@
1
+ /* @flow */
2
+
3
+ import {set_is_signed_in, set_uid} from "./index"
4
+
5
+ export const sign_out = () => {
6
+ set_uid(null)
7
+ set_is_signed_in(false)
8
+ localStorage.clear()
9
+
10
+ // TODO: clear DB
11
+ console.log("TODO cln")
12
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpcbase/client",
3
- "version": "0.87.0",
3
+ "version": "0.88.0",
4
4
  "scripts": {
5
5
  "build-firebase": "webpack -c firebase/webpack.config.js",
6
6
  "build": "yarn build-firebase",