relayx-webjs 1.1.1 → 1.1.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "relayx-webjs",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "A powerful library for integrating real-time communication into your webapps, powered by the Relay Network.",
5
5
  "main": "realtime/realtime.js",
6
6
  "type": "module",
@@ -579,12 +579,12 @@ export class Realtime {
579
579
  async initKVStore(){
580
580
 
581
581
  if(this.#kvStore == null){
582
- var debugCheck = this.opts.debug !== null && this.opts.debug !== undefined && typeof this.opts.debug == "boolean"
582
+ var debugCheck = this.opts?.debug !== null && this.opts?.debug !== undefined && typeof this.opts?.debug == "boolean"
583
583
 
584
584
  this.#kvStore = new KVStore({
585
585
  namespace: this.namespace,
586
586
  jetstream: this.#jetstream,
587
- debug: debugCheck ? this.opts.debug : false
587
+ debug: debugCheck ? this.opts?.debug : false
588
588
  })
589
589
 
590
590
  var init = await this.#kvStore.init()
@@ -958,8 +958,8 @@ export class Realtime {
958
958
  #getPublishRetry(){
959
959
  this.#log(this.opts)
960
960
  if(this.opts !== null && this.opts !== undefined){
961
- if(this.opts.max_retries !== null && this.opts.max_retries !== undefined){
962
- if (this.opts.max_retries <= 0){
961
+ if(this.opts?.max_retries !== null && this.opts?.max_retries !== undefined){
962
+ if (this.opts?.max_retries <= 0){
963
963
  return this.#maxPublishRetries;
964
964
  }else{
965
965
  return this.opts.max_retries;