@ezeep/ezeep-js 1.0.194 → 1.0.197

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.
@@ -33125,9 +33125,6 @@ let EzpPrinting = class {
33125
33125
  if (newValue !== oldValue && newValue.length > 0) {
33126
33126
  const uint8array = new TextEncoder().encode(newValue);
33127
33127
  this.file = new File([uint8array], this.filename, { type: 'application/pdf' });
33128
- if (authStore.state.isAuthorized) {
33129
- this.printOpen = true;
33130
- }
33131
33128
  }
33132
33129
  }
33133
33130
  watchFilename(newValue, oldValue) {
@@ -33188,8 +33185,7 @@ let EzpPrinting = class {
33188
33185
  *
33189
33186
  */
33190
33187
  async open() {
33191
- if (authStore.state.isAuthorized && this.trigger === 'file') {
33192
- this.authOpen = true;
33188
+ if (authStore.state.isAuthorized) {
33193
33189
  if (this.filename) {
33194
33190
  this.printOpen = true;
33195
33191
  }
@@ -33231,14 +33227,6 @@ let EzpPrinting = class {
33231
33227
  async checkAuth() {
33232
33228
  const printService = new EzpPrintService(this.redirecturi, this.clientid);
33233
33229
  let accessToken = authStore.state.accessToken;
33234
- if (accessToken === '') {
33235
- accessToken = localStorage.getItem('access_token');
33236
- authStore.state.accessToken = accessToken;
33237
- }
33238
- if (localStorage.getItem('isAuthorized')) {
33239
- authStore.state.isAuthorized = !!localStorage.getItem('isAuthorized');
33240
- this.authOpen = !authStore.state.isAuthorized;
33241
- }
33242
33230
  printService.getConfig(authStore.state.accessToken)
33243
33231
  .then((response) => {
33244
33232
  if (response.ok) {
@@ -33250,7 +33238,16 @@ let EzpPrinting = class {
33250
33238
  })
33251
33239
  .catch(() => {
33252
33240
  authStore.state.isAuthorized = false;
33241
+ return false;
33253
33242
  });
33243
+ if (accessToken === '') {
33244
+ accessToken = localStorage.getItem('access_token');
33245
+ authStore.state.accessToken = accessToken;
33246
+ }
33247
+ if (localStorage.getItem('isAuthorized')) {
33248
+ authStore.state.isAuthorized = !!localStorage.getItem('isAuthorized');
33249
+ this.authOpen = !authStore.state.isAuthorized;
33250
+ }
33254
33251
  return authStore.state.isAuthorized;
33255
33252
  }
33256
33253
  refreshTokensPeriodically(seconds) {
@@ -28,9 +28,6 @@ export class EzpPrinting {
28
28
  if (newValue !== oldValue && newValue.length > 0) {
29
29
  const uint8array = new TextEncoder().encode(newValue);
30
30
  this.file = new File([uint8array], this.filename, { type: 'application/pdf' });
31
- if (authStore.state.isAuthorized) {
32
- this.printOpen = true;
33
- }
34
31
  }
35
32
  }
36
33
  watchFilename(newValue, oldValue) {
@@ -91,8 +88,7 @@ export class EzpPrinting {
91
88
  *
92
89
  */
93
90
  async open() {
94
- if (authStore.state.isAuthorized && this.trigger === 'file') {
95
- this.authOpen = true;
91
+ if (authStore.state.isAuthorized) {
96
92
  if (this.filename) {
97
93
  this.printOpen = true;
98
94
  }
@@ -134,14 +130,6 @@ export class EzpPrinting {
134
130
  async checkAuth() {
135
131
  const printService = new EzpPrintService(this.redirecturi, this.clientid);
136
132
  let accessToken = authStore.state.accessToken;
137
- if (accessToken === '') {
138
- accessToken = localStorage.getItem('access_token');
139
- authStore.state.accessToken = accessToken;
140
- }
141
- if (localStorage.getItem('isAuthorized')) {
142
- authStore.state.isAuthorized = !!localStorage.getItem('isAuthorized');
143
- this.authOpen = !authStore.state.isAuthorized;
144
- }
145
133
  printService.getConfig(authStore.state.accessToken)
146
134
  .then((response) => {
147
135
  if (response.ok) {
@@ -153,7 +141,16 @@ export class EzpPrinting {
153
141
  })
154
142
  .catch(() => {
155
143
  authStore.state.isAuthorized = false;
144
+ return false;
156
145
  });
146
+ if (accessToken === '') {
147
+ accessToken = localStorage.getItem('access_token');
148
+ authStore.state.accessToken = accessToken;
149
+ }
150
+ if (localStorage.getItem('isAuthorized')) {
151
+ authStore.state.isAuthorized = !!localStorage.getItem('isAuthorized');
152
+ this.authOpen = !authStore.state.isAuthorized;
153
+ }
157
154
  return authStore.state.isAuthorized;
158
155
  }
159
156
  refreshTokensPeriodically(seconds) {
@@ -33150,9 +33150,6 @@ let EzpPrinting$1 = class extends HTMLElement {
33150
33150
  if (newValue !== oldValue && newValue.length > 0) {
33151
33151
  const uint8array = new TextEncoder().encode(newValue);
33152
33152
  this.file = new File([uint8array], this.filename, { type: 'application/pdf' });
33153
- if (authStore.state.isAuthorized) {
33154
- this.printOpen = true;
33155
- }
33156
33153
  }
33157
33154
  }
33158
33155
  watchFilename(newValue, oldValue) {
@@ -33213,8 +33210,7 @@ let EzpPrinting$1 = class extends HTMLElement {
33213
33210
  *
33214
33211
  */
33215
33212
  async open() {
33216
- if (authStore.state.isAuthorized && this.trigger === 'file') {
33217
- this.authOpen = true;
33213
+ if (authStore.state.isAuthorized) {
33218
33214
  if (this.filename) {
33219
33215
  this.printOpen = true;
33220
33216
  }
@@ -33256,14 +33252,6 @@ let EzpPrinting$1 = class extends HTMLElement {
33256
33252
  async checkAuth() {
33257
33253
  const printService = new EzpPrintService(this.redirecturi, this.clientid);
33258
33254
  let accessToken = authStore.state.accessToken;
33259
- if (accessToken === '') {
33260
- accessToken = localStorage.getItem('access_token');
33261
- authStore.state.accessToken = accessToken;
33262
- }
33263
- if (localStorage.getItem('isAuthorized')) {
33264
- authStore.state.isAuthorized = !!localStorage.getItem('isAuthorized');
33265
- this.authOpen = !authStore.state.isAuthorized;
33266
- }
33267
33255
  printService.getConfig(authStore.state.accessToken)
33268
33256
  .then((response) => {
33269
33257
  if (response.ok) {
@@ -33275,7 +33263,16 @@ let EzpPrinting$1 = class extends HTMLElement {
33275
33263
  })
33276
33264
  .catch(() => {
33277
33265
  authStore.state.isAuthorized = false;
33266
+ return false;
33278
33267
  });
33268
+ if (accessToken === '') {
33269
+ accessToken = localStorage.getItem('access_token');
33270
+ authStore.state.accessToken = accessToken;
33271
+ }
33272
+ if (localStorage.getItem('isAuthorized')) {
33273
+ authStore.state.isAuthorized = !!localStorage.getItem('isAuthorized');
33274
+ this.authOpen = !authStore.state.isAuthorized;
33275
+ }
33279
33276
  return authStore.state.isAuthorized;
33280
33277
  }
33281
33278
  refreshTokensPeriodically(seconds) {
@@ -33121,9 +33121,6 @@ let EzpPrinting = class {
33121
33121
  if (newValue !== oldValue && newValue.length > 0) {
33122
33122
  const uint8array = new TextEncoder().encode(newValue);
33123
33123
  this.file = new File([uint8array], this.filename, { type: 'application/pdf' });
33124
- if (authStore.state.isAuthorized) {
33125
- this.printOpen = true;
33126
- }
33127
33124
  }
33128
33125
  }
33129
33126
  watchFilename(newValue, oldValue) {
@@ -33184,8 +33181,7 @@ let EzpPrinting = class {
33184
33181
  *
33185
33182
  */
33186
33183
  async open() {
33187
- if (authStore.state.isAuthorized && this.trigger === 'file') {
33188
- this.authOpen = true;
33184
+ if (authStore.state.isAuthorized) {
33189
33185
  if (this.filename) {
33190
33186
  this.printOpen = true;
33191
33187
  }
@@ -33227,14 +33223,6 @@ let EzpPrinting = class {
33227
33223
  async checkAuth() {
33228
33224
  const printService = new EzpPrintService(this.redirecturi, this.clientid);
33229
33225
  let accessToken = authStore.state.accessToken;
33230
- if (accessToken === '') {
33231
- accessToken = localStorage.getItem('access_token');
33232
- authStore.state.accessToken = accessToken;
33233
- }
33234
- if (localStorage.getItem('isAuthorized')) {
33235
- authStore.state.isAuthorized = !!localStorage.getItem('isAuthorized');
33236
- this.authOpen = !authStore.state.isAuthorized;
33237
- }
33238
33226
  printService.getConfig(authStore.state.accessToken)
33239
33227
  .then((response) => {
33240
33228
  if (response.ok) {
@@ -33246,7 +33234,16 @@ let EzpPrinting = class {
33246
33234
  })
33247
33235
  .catch(() => {
33248
33236
  authStore.state.isAuthorized = false;
33237
+ return false;
33249
33238
  });
33239
+ if (accessToken === '') {
33240
+ accessToken = localStorage.getItem('access_token');
33241
+ authStore.state.accessToken = accessToken;
33242
+ }
33243
+ if (localStorage.getItem('isAuthorized')) {
33244
+ authStore.state.isAuthorized = !!localStorage.getItem('isAuthorized');
33245
+ this.authOpen = !authStore.state.isAuthorized;
33246
+ }
33250
33247
  return authStore.state.isAuthorized;
33251
33248
  }
33252
33249
  refreshTokensPeriodically(seconds) {