glitch-javascript-sdk 0.4.2 → 0.4.3

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.
@@ -10,6 +10,7 @@ declare class Session {
10
10
  static getFirstName(): string | null;
11
11
  static getLastName(): string | null;
12
12
  static getEmail(): string | null;
13
+ static hasJoinedCommunity(): boolean;
13
14
  static end(): void;
14
15
  static processAuthentication(data: {
15
16
  token: {
package/dist/index.d.ts CHANGED
@@ -1746,6 +1746,7 @@ declare class Session {
1746
1746
  static getFirstName(): string | null;
1747
1747
  static getLastName(): string | null;
1748
1748
  static getEmail(): string | null;
1749
+ static hasJoinedCommunity(): boolean;
1749
1750
  static end(): void;
1750
1751
  static processAuthentication(data: {
1751
1752
  token: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -34,6 +34,16 @@ class Session {
34
34
  return Storage.get(Session._email_key);
35
35
  }
36
36
 
37
+ public static hasJoinedCommunity() {
38
+ const community = Storage.get('community');
39
+
40
+ if(!community) {
41
+ return false;
42
+ }
43
+
44
+ return (community?.me) ? true : false;
45
+ }
46
+
37
47
  public static end(): void {
38
48
  Storage.setAuthToken(null);
39
49
  Storage.set(Session._id_key, null);