chayns-api 1.1.8 → 1.1.9
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.
|
@@ -418,6 +418,25 @@ class AppWrapper {
|
|
|
418
418
|
}
|
|
419
419
|
},
|
|
420
420
|
selectPage: async options => {
|
|
421
|
+
var _this$values, _this$values2;
|
|
422
|
+
if ((_this$values = this.values) !== null && _this$values !== void 0 && (_this$values = _this$values.site) !== null && _this$values !== void 0 && _this$values.id && options.siteId && options.siteId !== ((_this$values2 = this.values) === null || _this$values2 === void 0 || (_this$values2 = _this$values2.site) === null || _this$values2 === void 0 ? void 0 : _this$values2.id)) {
|
|
423
|
+
const url = new URL(`https://chayns.site/${options.siteId}`);
|
|
424
|
+
if (options.id) {
|
|
425
|
+
url.pathname += `/tapp/${options.id}`;
|
|
426
|
+
} else if (options.path) {
|
|
427
|
+
url.pathname += `/${options.path}`;
|
|
428
|
+
}
|
|
429
|
+
if (options.params) {
|
|
430
|
+
Object.entries(options.params).forEach(([k, v]) => {
|
|
431
|
+
url.searchParams.set(k, v);
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
void this.appCall(9, {
|
|
435
|
+
url: url.toString(),
|
|
436
|
+
checkForChaynsSite: true
|
|
437
|
+
});
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
421
440
|
void this.appCall(2, {
|
|
422
441
|
id: options.id,
|
|
423
442
|
showName: options.showName,
|
|
@@ -381,6 +381,26 @@ export class AppWrapper {
|
|
|
381
381
|
}
|
|
382
382
|
},
|
|
383
383
|
selectPage: async options => {
|
|
384
|
+
var _this$values, _this$values2;
|
|
385
|
+
if ((_this$values = this.values) !== null && _this$values !== void 0 && (_this$values = _this$values.site) !== null && _this$values !== void 0 && _this$values.id && options.siteId && options.siteId !== ((_this$values2 = this.values) === null || _this$values2 === void 0 || (_this$values2 = _this$values2.site) === null || _this$values2 === void 0 ? void 0 : _this$values2.id)) {
|
|
386
|
+
const url = new URL(`https://chayns.site/${options.siteId}`);
|
|
387
|
+
if (options.id) {
|
|
388
|
+
url.pathname += `/tapp/${options.id}`;
|
|
389
|
+
} else if (options.path) {
|
|
390
|
+
url.pathname += `/${options.path}`;
|
|
391
|
+
}
|
|
392
|
+
if (options.params) {
|
|
393
|
+
Object.entries(options.params).forEach(_ref2 => {
|
|
394
|
+
let [k, v] = _ref2;
|
|
395
|
+
url.searchParams.set(k, v);
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
void this.appCall(9, {
|
|
399
|
+
url: url.toString(),
|
|
400
|
+
checkForChaynsSite: true
|
|
401
|
+
});
|
|
402
|
+
return;
|
|
403
|
+
}
|
|
384
404
|
void this.appCall(2, {
|
|
385
405
|
id: options.id,
|
|
386
406
|
showName: options.showName,
|
|
@@ -593,10 +613,10 @@ export class AppWrapper {
|
|
|
593
613
|
this.appCall(254, {
|
|
594
614
|
enabled: true
|
|
595
615
|
}, {
|
|
596
|
-
callback:
|
|
616
|
+
callback: _ref3 => {
|
|
597
617
|
let {
|
|
598
618
|
colorMode
|
|
599
|
-
} =
|
|
619
|
+
} = _ref3;
|
|
600
620
|
this.values.site = {
|
|
601
621
|
...this.values.site,
|
|
602
622
|
colorMode
|