@geexcode/geex-angular 0.0.31 → 0.0.32

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/dist/index.js CHANGED
@@ -238,10 +238,12 @@ function createMessagingModule(injector) {
238
238
  const module2 = {
239
239
  async init() {
240
240
  try {
241
- const subClient = injector.get(import_apollo_angular.Apollo).use("subscription");
242
- subClient.subscribe({ query: GQL_ON_PUBLIC_NOTIFY }).pipe((0, import_rxjs.map)((res) => res?.data?.onPublicNotify)).subscribe((notify) => {
243
- module2.onPublicNotify(notify);
244
- });
241
+ if (injector.get(import_angular_oauth2_oidc.OAuthService).hasValidAccessToken()) {
242
+ const subClient = injector.get(import_apollo_angular.Apollo).use("subscription");
243
+ subClient.subscribe({ query: GQL_ON_PUBLIC_NOTIFY }).pipe((0, import_rxjs.map)((res) => res?.data?.onPublicNotify)).subscribe((notify) => {
244
+ module2.onPublicNotify(notify);
245
+ });
246
+ }
245
247
  } catch (err) {
246
248
  console.error(err);
247
249
  }
package/dist/index.mjs CHANGED
@@ -192,10 +192,12 @@ function createMessagingModule(injector) {
192
192
  const module = {
193
193
  async init() {
194
194
  try {
195
- const subClient = injector.get(Apollo).use("subscription");
196
- subClient.subscribe({ query: GQL_ON_PUBLIC_NOTIFY }).pipe(map((res) => res?.data?.onPublicNotify)).subscribe((notify) => {
197
- module.onPublicNotify(notify);
198
- });
195
+ if (injector.get(OAuthService).hasValidAccessToken()) {
196
+ const subClient = injector.get(Apollo).use("subscription");
197
+ subClient.subscribe({ query: GQL_ON_PUBLIC_NOTIFY }).pipe(map((res) => res?.data?.onPublicNotify)).subscribe((notify) => {
198
+ module.onPublicNotify(notify);
199
+ });
200
+ }
199
201
  } catch (err) {
200
202
  console.error(err);
201
203
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geexcode/geex-angular",
3
- "version": "0.0.31",
3
+ "version": "0.0.32",
4
4
  "description": "Angular adapter for Geex core.",
5
5
  "module": "dist/index.js",
6
6
  "main": "dist/index.cjs",