@banta/sdk 4.6.1 → 4.6.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/bundles/banta-sdk.umd.js +92 -91
- package/bundles/banta-sdk.umd.js.map +1 -1
- package/bundles/banta-sdk.umd.min.js +1 -1
- package/bundles/banta-sdk.umd.min.js.map +1 -1
- package/esm2015/lib/comments/banta-comments/banta-comments.component.js +5 -4
- package/fesm2015/banta-sdk.js +4 -3
- package/fesm2015/banta-sdk.js.map +1 -1
- package/package.json +1 -1
package/bundles/banta-sdk.umd.js
CHANGED
|
@@ -9095,25 +9095,25 @@
|
|
|
9095
9095
|
];
|
|
9096
9096
|
this.sendMessage = function (message) { return __awaiter(_this, void 0, void 0, function () {
|
|
9097
9097
|
var _a, intercept, e_1;
|
|
9098
|
-
return __generator(this, function (
|
|
9099
|
-
switch (
|
|
9098
|
+
return __generator(this, function (_e) {
|
|
9099
|
+
switch (_e.label) {
|
|
9100
9100
|
case 0:
|
|
9101
|
-
|
|
9101
|
+
_e.trys.push([0, 4, , 5]);
|
|
9102
9102
|
return [4 /*yield*/, ((_a = this.shouldInterceptMessageSend) === null || _a === void 0 ? void 0 : _a.call(this, message, this.source))];
|
|
9103
9103
|
case 1:
|
|
9104
|
-
intercept =
|
|
9104
|
+
intercept = _e.sent();
|
|
9105
9105
|
if (!!intercept) return [3 /*break*/, 3];
|
|
9106
9106
|
return [4 /*yield*/, this.source.send(message)];
|
|
9107
9107
|
case 2:
|
|
9108
|
-
|
|
9109
|
-
|
|
9108
|
+
_e.sent();
|
|
9109
|
+
_e.label = 3;
|
|
9110
9110
|
case 3:
|
|
9111
9111
|
if (this.source.sortOrder !== common$1.CommentsOrder.NEWEST) {
|
|
9112
9112
|
this.sortOrder = common$1.CommentsOrder.NEWEST;
|
|
9113
9113
|
}
|
|
9114
9114
|
return [2 /*return*/, true];
|
|
9115
9115
|
case 4:
|
|
9116
|
-
e_1 =
|
|
9116
|
+
e_1 = _e.sent();
|
|
9117
9117
|
this.handleBackendException(e_1, 'Could not send: ');
|
|
9118
9118
|
return [3 /*break*/, 5];
|
|
9119
9119
|
case 5: return [2 /*return*/];
|
|
@@ -9122,21 +9122,21 @@
|
|
|
9122
9122
|
}); };
|
|
9123
9123
|
this.sendReply = function (message) { return __awaiter(_this, void 0, void 0, function () {
|
|
9124
9124
|
var _b, intercept, e_2;
|
|
9125
|
-
return __generator(this, function (
|
|
9126
|
-
switch (
|
|
9125
|
+
return __generator(this, function (_e) {
|
|
9126
|
+
switch (_e.label) {
|
|
9127
9127
|
case 0:
|
|
9128
|
-
|
|
9128
|
+
_e.trys.push([0, 4, , 5]);
|
|
9129
9129
|
return [4 /*yield*/, ((_b = this.shouldInterceptMessageSend) === null || _b === void 0 ? void 0 : _b.call(this, message, this.selectedMessageThread))];
|
|
9130
9130
|
case 1:
|
|
9131
|
-
intercept =
|
|
9131
|
+
intercept = _e.sent();
|
|
9132
9132
|
if (!!intercept) return [3 /*break*/, 3];
|
|
9133
9133
|
return [4 /*yield*/, this.selectedMessageThread.send(message)];
|
|
9134
9134
|
case 2:
|
|
9135
|
-
|
|
9136
|
-
|
|
9135
|
+
_e.sent();
|
|
9136
|
+
_e.label = 3;
|
|
9137
9137
|
case 3: return [2 /*return*/, true];
|
|
9138
9138
|
case 4:
|
|
9139
|
-
e_2 =
|
|
9139
|
+
e_2 = _e.sent();
|
|
9140
9140
|
this.handleBackendException(e_2, 'Could not send reply: ');
|
|
9141
9141
|
return [3 /*break*/, 5];
|
|
9142
9142
|
case 5: return [2 /*return*/];
|
|
@@ -9183,9 +9183,9 @@
|
|
|
9183
9183
|
var queryString = window.location.search.substring(1);
|
|
9184
9184
|
var query = queryString.split('&')
|
|
9185
9185
|
.map(function (s) { return s.split('='); })
|
|
9186
|
-
.reduce(function (o,
|
|
9187
|
-
var
|
|
9188
|
-
return (o[k] = v, o);
|
|
9186
|
+
.reduce(function (o, _e) {
|
|
9187
|
+
var _f = __read(_e, 2), k = _f[0], v = _f[1];
|
|
9188
|
+
return (o[decodeURIComponent(k)] = decodeURIComponent(v), o);
|
|
9189
9189
|
}, {});
|
|
9190
9190
|
var commentID = query['comment'];
|
|
9191
9191
|
if (commentID) {
|
|
@@ -9234,19 +9234,19 @@
|
|
|
9234
9234
|
BantaCommentsComponent.prototype.setSourceFromTopicID = function (topicID) {
|
|
9235
9235
|
return __awaiter(this, void 0, void 0, function () {
|
|
9236
9236
|
var _this = this;
|
|
9237
|
-
return __generator(this, function (
|
|
9237
|
+
return __generator(this, function (_e) {
|
|
9238
9238
|
if (typeof window === 'undefined')
|
|
9239
9239
|
return [2 /*return*/];
|
|
9240
9240
|
setTimeout(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
9241
|
-
var
|
|
9242
|
-
return __generator(this, function (
|
|
9243
|
-
switch (
|
|
9241
|
+
var _e;
|
|
9242
|
+
return __generator(this, function (_f) {
|
|
9243
|
+
switch (_f.label) {
|
|
9244
9244
|
case 0:
|
|
9245
9245
|
console.log("[banta-comments] Subscribing to topic source '" + topicID + "'");
|
|
9246
|
-
|
|
9246
|
+
_e = this;
|
|
9247
9247
|
return [4 /*yield*/, this.backend.getSourceForTopic(topicID, { sortOrder: this.sortOrder })];
|
|
9248
9248
|
case 1:
|
|
9249
|
-
|
|
9249
|
+
_e.source = _f.sent();
|
|
9250
9250
|
this._sourceIsOwned = true;
|
|
9251
9251
|
return [2 /*return*/];
|
|
9252
9252
|
}
|
|
@@ -9277,25 +9277,25 @@
|
|
|
9277
9277
|
BantaCommentsComponent.prototype.startLoading = function () {
|
|
9278
9278
|
return __awaiter(this, void 0, void 0, function () {
|
|
9279
9279
|
var _this = this;
|
|
9280
|
-
return __generator(this, function (
|
|
9281
|
-
switch (
|
|
9280
|
+
return __generator(this, function (_e) {
|
|
9281
|
+
switch (_e.label) {
|
|
9282
9282
|
case 0:
|
|
9283
9283
|
this.loadingStartedAt = this.messageChangedAt = Date.now();
|
|
9284
9284
|
if (this.updateLoading())
|
|
9285
9285
|
return [2 /*return*/];
|
|
9286
9286
|
return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(function () { return resolve(); }, 100); })];
|
|
9287
9287
|
case 1:
|
|
9288
|
-
|
|
9288
|
+
_e.sent();
|
|
9289
9289
|
if (this.updateLoading())
|
|
9290
9290
|
return [2 /*return*/];
|
|
9291
9291
|
return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(function () { return resolve(); }, 250); })];
|
|
9292
9292
|
case 2:
|
|
9293
|
-
|
|
9293
|
+
_e.sent();
|
|
9294
9294
|
if (this.updateLoading())
|
|
9295
9295
|
return [2 /*return*/];
|
|
9296
9296
|
return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(function () { return resolve(); }, 500); })];
|
|
9297
9297
|
case 3:
|
|
9298
|
-
|
|
9298
|
+
_e.sent();
|
|
9299
9299
|
if (this.updateLoading())
|
|
9300
9300
|
return [2 /*return*/];
|
|
9301
9301
|
console.log("[Banta] Loading is taking a long time! Showing loading screen.");
|
|
@@ -9483,26 +9483,26 @@
|
|
|
9483
9483
|
}, 1000);
|
|
9484
9484
|
};
|
|
9485
9485
|
BantaCommentsComponent.prototype.navigateToSharedComment = function (id) {
|
|
9486
|
-
var _a, _b, _c;
|
|
9486
|
+
var _a, _b, _c, _d;
|
|
9487
9487
|
return __awaiter(this, void 0, void 0, function () {
|
|
9488
9488
|
var source, message, e_3, parentMessage, thread;
|
|
9489
|
-
return __generator(this, function (
|
|
9490
|
-
switch (
|
|
9489
|
+
return __generator(this, function (_e) {
|
|
9490
|
+
switch (_e.label) {
|
|
9491
9491
|
case 0:
|
|
9492
9492
|
source = this.source;
|
|
9493
9493
|
return [4 /*yield*/, source.ready];
|
|
9494
9494
|
case 1:
|
|
9495
|
-
|
|
9495
|
+
_e.sent();
|
|
9496
9496
|
console.log("Navigating to shared comment with ID '" + id + "'...");
|
|
9497
|
-
|
|
9497
|
+
_e.label = 2;
|
|
9498
9498
|
case 2:
|
|
9499
|
-
|
|
9499
|
+
_e.trys.push([2, 4, , 5]);
|
|
9500
9500
|
return [4 /*yield*/, this.source.get(id)];
|
|
9501
9501
|
case 3:
|
|
9502
|
-
message =
|
|
9502
|
+
message = _e.sent();
|
|
9503
9503
|
return [3 /*break*/, 5];
|
|
9504
9504
|
case 4:
|
|
9505
|
-
e_3 =
|
|
9505
|
+
e_3 = _e.sent();
|
|
9506
9506
|
console.error("Failed to find comment from URL: " + e_3.message);
|
|
9507
9507
|
return [2 /*return*/];
|
|
9508
9508
|
case 5:
|
|
@@ -9510,31 +9510,32 @@
|
|
|
9510
9510
|
if (!message.parentMessageId) return [3 /*break*/, 11];
|
|
9511
9511
|
return [4 /*yield*/, this.source.get(message.parentMessageId)];
|
|
9512
9512
|
case 6:
|
|
9513
|
-
parentMessage =
|
|
9513
|
+
parentMessage = _e.sent();
|
|
9514
9514
|
(_b = parentMessage.transientState) !== null && _b !== void 0 ? _b : (parentMessage.transientState = {});
|
|
9515
9515
|
return [4 /*yield*/, this.selectMessage(parentMessage)];
|
|
9516
9516
|
case 7:
|
|
9517
|
-
thread =
|
|
9517
|
+
thread = _e.sent();
|
|
9518
9518
|
// Need to re-retrieve the message within the new chat source to affect its
|
|
9519
9519
|
// transient state.
|
|
9520
9520
|
return [4 /*yield*/, thread.ready];
|
|
9521
9521
|
case 8:
|
|
9522
9522
|
// Need to re-retrieve the message within the new chat source to affect its
|
|
9523
9523
|
// transient state.
|
|
9524
|
-
|
|
9524
|
+
_e.sent();
|
|
9525
9525
|
return [4 /*yield*/, thread.get(message.id)];
|
|
9526
9526
|
case 9:
|
|
9527
|
-
message =
|
|
9527
|
+
message = _e.sent();
|
|
9528
9528
|
(_c = message.transientState) !== null && _c !== void 0 ? _c : (message.transientState = {});
|
|
9529
9529
|
message.transientState.highlighted = true;
|
|
9530
9530
|
console.dir(message);
|
|
9531
9531
|
return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(function () { return resolve(); }, 500); })];
|
|
9532
9532
|
case 10:
|
|
9533
|
-
|
|
9533
|
+
_e.sent();
|
|
9534
9534
|
return [3 /*break*/, 12];
|
|
9535
9535
|
case 11:
|
|
9536
|
-
|
|
9537
|
-
|
|
9536
|
+
(_d = message.transientState) !== null && _d !== void 0 ? _d : (message.transientState = {});
|
|
9537
|
+
message.transientState.highlighted = true;
|
|
9538
|
+
_e.label = 12;
|
|
9538
9539
|
case 12:
|
|
9539
9540
|
this.scrollToComment(id);
|
|
9540
9541
|
return [2 /*return*/];
|
|
@@ -9573,31 +9574,31 @@
|
|
|
9573
9574
|
BantaCommentsComponent.prototype.likeMessage = function (source, message) {
|
|
9574
9575
|
return __awaiter(this, void 0, void 0, function () {
|
|
9575
9576
|
var e_4;
|
|
9576
|
-
return __generator(this, function (
|
|
9577
|
-
switch (
|
|
9577
|
+
return __generator(this, function (_e) {
|
|
9578
|
+
switch (_e.label) {
|
|
9578
9579
|
case 0:
|
|
9579
9580
|
if (!!this.user) return [3 /*break*/, 2];
|
|
9580
9581
|
return [4 /*yield*/, this.showSignIn()];
|
|
9581
9582
|
case 1:
|
|
9582
|
-
|
|
9583
|
+
_e.sent();
|
|
9583
9584
|
return [2 /*return*/];
|
|
9584
9585
|
case 2:
|
|
9585
9586
|
this._upvoted.next(message);
|
|
9586
9587
|
message.transientState.liking = true;
|
|
9587
|
-
|
|
9588
|
+
_e.label = 3;
|
|
9588
9589
|
case 3:
|
|
9589
|
-
|
|
9590
|
+
_e.trys.push([3, 5, 6, 8]);
|
|
9590
9591
|
return [4 /*yield*/, source.likeMessage(message.id)];
|
|
9591
9592
|
case 4:
|
|
9592
|
-
|
|
9593
|
+
_e.sent();
|
|
9593
9594
|
return [3 /*break*/, 8];
|
|
9594
9595
|
case 5:
|
|
9595
|
-
e_4 =
|
|
9596
|
+
e_4 = _e.sent();
|
|
9596
9597
|
this.handleBackendExceptionAsAlert(e_4, 'Could not like this message: ');
|
|
9597
9598
|
return [3 /*break*/, 8];
|
|
9598
9599
|
case 6: return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(function () { return resolve(); }, 250); })];
|
|
9599
9600
|
case 7:
|
|
9600
|
-
|
|
9601
|
+
_e.sent();
|
|
9601
9602
|
message.transientState.liking = false;
|
|
9602
9603
|
return [7 /*endfinally*/];
|
|
9603
9604
|
case 8: return [2 /*return*/];
|
|
@@ -9609,33 +9610,33 @@
|
|
|
9609
9610
|
var _a;
|
|
9610
9611
|
return __awaiter(this, void 0, void 0, function () {
|
|
9611
9612
|
var e_5;
|
|
9612
|
-
return __generator(this, function (
|
|
9613
|
-
switch (
|
|
9613
|
+
return __generator(this, function (_e) {
|
|
9614
|
+
switch (_e.label) {
|
|
9614
9615
|
case 0:
|
|
9615
9616
|
if (!!this.user) return [3 /*break*/, 2];
|
|
9616
9617
|
return [4 /*yield*/, this.showSignIn()];
|
|
9617
9618
|
case 1:
|
|
9618
|
-
|
|
9619
|
+
_e.sent();
|
|
9619
9620
|
return [2 /*return*/];
|
|
9620
9621
|
case 2:
|
|
9621
9622
|
this._upvoted.next(message);
|
|
9622
9623
|
message.transientState.liking = true;
|
|
9623
9624
|
if ((_a = message.userState) === null || _a === void 0 ? void 0 : _a.liked)
|
|
9624
9625
|
message.likes = (message.likes || 0) - 1;
|
|
9625
|
-
|
|
9626
|
+
_e.label = 3;
|
|
9626
9627
|
case 3:
|
|
9627
|
-
|
|
9628
|
+
_e.trys.push([3, 5, , 6]);
|
|
9628
9629
|
return [4 /*yield*/, source.unlikeMessage(message.id)];
|
|
9629
9630
|
case 4:
|
|
9630
|
-
|
|
9631
|
+
_e.sent();
|
|
9631
9632
|
return [3 /*break*/, 6];
|
|
9632
9633
|
case 5:
|
|
9633
|
-
e_5 =
|
|
9634
|
+
e_5 = _e.sent();
|
|
9634
9635
|
this.handleBackendExceptionAsAlert(e_5, 'Failed to unlike this message: ');
|
|
9635
9636
|
return [3 /*break*/, 6];
|
|
9636
9637
|
case 6: return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(function () { return resolve(); }, 250); })];
|
|
9637
9638
|
case 7:
|
|
9638
|
-
|
|
9639
|
+
_e.sent();
|
|
9639
9640
|
message.transientState.liking = false;
|
|
9640
9641
|
return [2 /*return*/];
|
|
9641
9642
|
}
|
|
@@ -9644,7 +9645,7 @@
|
|
|
9644
9645
|
};
|
|
9645
9646
|
BantaCommentsComponent.prototype.reportMessage = function (message) {
|
|
9646
9647
|
return __awaiter(this, void 0, void 0, function () {
|
|
9647
|
-
return __generator(this, function (
|
|
9648
|
+
return __generator(this, function (_e) {
|
|
9648
9649
|
this._reported.next(message);
|
|
9649
9650
|
return [2 /*return*/];
|
|
9650
9651
|
});
|
|
@@ -9654,7 +9655,7 @@
|
|
|
9654
9655
|
return __awaiter(this, void 0, void 0, function () {
|
|
9655
9656
|
var message;
|
|
9656
9657
|
var _this = this;
|
|
9657
|
-
return __generator(this, function (
|
|
9658
|
+
return __generator(this, function (_e) {
|
|
9658
9659
|
message = this.selectedMessage;
|
|
9659
9660
|
this._selected.next(null);
|
|
9660
9661
|
this.selectedMessage = null;
|
|
@@ -9673,8 +9674,8 @@
|
|
|
9673
9674
|
return __awaiter(this, void 0, void 0, function () {
|
|
9674
9675
|
var selectedMessageThread;
|
|
9675
9676
|
var _this = this;
|
|
9676
|
-
return __generator(this, function (
|
|
9677
|
-
switch (
|
|
9677
|
+
return __generator(this, function (_e) {
|
|
9678
|
+
switch (_e.label) {
|
|
9678
9679
|
case 0:
|
|
9679
9680
|
if (this.selectedMessage === message) {
|
|
9680
9681
|
this.unselectMessage();
|
|
@@ -9684,10 +9685,10 @@
|
|
|
9684
9685
|
this.selectedMessage = message;
|
|
9685
9686
|
return [4 /*yield*/, this.backend.getSourceForThread(this.topicID, message.id)];
|
|
9686
9687
|
case 1:
|
|
9687
|
-
selectedMessageThread =
|
|
9688
|
+
selectedMessageThread = _e.sent();
|
|
9688
9689
|
setTimeout(function () { return _this.selectedMessageVisible = true; });
|
|
9689
9690
|
setTimeout(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
9690
|
-
return __generator(this, function (
|
|
9691
|
+
return __generator(this, function (_e) {
|
|
9691
9692
|
this.selectedMessageThread = selectedMessageThread;
|
|
9692
9693
|
return [2 /*return*/];
|
|
9693
9694
|
});
|
|
@@ -9699,7 +9700,7 @@
|
|
|
9699
9700
|
};
|
|
9700
9701
|
BantaCommentsComponent.prototype.showSignIn = function () {
|
|
9701
9702
|
return __awaiter(this, void 0, void 0, function () {
|
|
9702
|
-
return __generator(this, function (
|
|
9703
|
+
return __generator(this, function (_e) {
|
|
9703
9704
|
this._signInSelected.next();
|
|
9704
9705
|
return [2 /*return*/];
|
|
9705
9706
|
});
|
|
@@ -9707,7 +9708,7 @@
|
|
|
9707
9708
|
};
|
|
9708
9709
|
BantaCommentsComponent.prototype.showEditAvatar = function () {
|
|
9709
9710
|
return __awaiter(this, void 0, void 0, function () {
|
|
9710
|
-
return __generator(this, function (
|
|
9711
|
+
return __generator(this, function (_e) {
|
|
9711
9712
|
this._editAvatarSelected.next();
|
|
9712
9713
|
return [2 /*return*/];
|
|
9713
9714
|
});
|
|
@@ -9715,7 +9716,7 @@
|
|
|
9715
9716
|
};
|
|
9716
9717
|
BantaCommentsComponent.prototype.selectMessageUser = function (message) {
|
|
9717
9718
|
return __awaiter(this, void 0, void 0, function () {
|
|
9718
|
-
return __generator(this, function (
|
|
9719
|
+
return __generator(this, function (_e) {
|
|
9719
9720
|
this._userSelected.next(message);
|
|
9720
9721
|
return [2 /*return*/];
|
|
9721
9722
|
});
|
|
@@ -9723,7 +9724,7 @@
|
|
|
9723
9724
|
};
|
|
9724
9725
|
BantaCommentsComponent.prototype.selectUsername = function (user) {
|
|
9725
9726
|
return __awaiter(this, void 0, void 0, function () {
|
|
9726
|
-
return __generator(this, function (
|
|
9727
|
+
return __generator(this, function (_e) {
|
|
9727
9728
|
this._usernameSelected.next(user);
|
|
9728
9729
|
return [2 /*return*/];
|
|
9729
9730
|
});
|
|
@@ -9731,7 +9732,7 @@
|
|
|
9731
9732
|
};
|
|
9732
9733
|
BantaCommentsComponent.prototype.selectAvatar = function (user) {
|
|
9733
9734
|
return __awaiter(this, void 0, void 0, function () {
|
|
9734
|
-
return __generator(this, function (
|
|
9735
|
+
return __generator(this, function (_e) {
|
|
9735
9736
|
this._avatarSelected.next(user);
|
|
9736
9737
|
return [2 /*return*/];
|
|
9737
9738
|
});
|
|
@@ -9739,7 +9740,7 @@
|
|
|
9739
9740
|
};
|
|
9740
9741
|
BantaCommentsComponent.prototype.shareMessage = function (message) {
|
|
9741
9742
|
return __awaiter(this, void 0, void 0, function () {
|
|
9742
|
-
return __generator(this, function (
|
|
9743
|
+
return __generator(this, function (_e) {
|
|
9743
9744
|
this._shared.next(message);
|
|
9744
9745
|
return [2 /*return*/];
|
|
9745
9746
|
});
|
|
@@ -9749,28 +9750,28 @@
|
|
|
9749
9750
|
var _a;
|
|
9750
9751
|
return __awaiter(this, void 0, void 0, function () {
|
|
9751
9752
|
var e_6;
|
|
9752
|
-
return __generator(this, function (
|
|
9753
|
-
switch (
|
|
9753
|
+
return __generator(this, function (_e) {
|
|
9754
|
+
switch (_e.label) {
|
|
9754
9755
|
case 0:
|
|
9755
9756
|
if (!!this.user) return [3 /*break*/, 2];
|
|
9756
9757
|
return [4 /*yield*/, this.showSignIn()];
|
|
9757
9758
|
case 1:
|
|
9758
|
-
|
|
9759
|
+
_e.sent();
|
|
9759
9760
|
return [2 /*return*/];
|
|
9760
9761
|
case 2:
|
|
9761
9762
|
if (!confirm("Are you sure you want to delete this comment? You cannot undo this action."))
|
|
9762
9763
|
return [2 /*return*/];
|
|
9763
|
-
|
|
9764
|
+
_e.label = 3;
|
|
9764
9765
|
case 3:
|
|
9765
|
-
|
|
9766
|
+
_e.trys.push([3, 5, , 6]);
|
|
9766
9767
|
return [4 /*yield*/, this.source.deleteMessage(message.id)];
|
|
9767
9768
|
case 4:
|
|
9768
|
-
|
|
9769
|
+
_e.sent();
|
|
9769
9770
|
if (((_a = this.selectedMessage) === null || _a === void 0 ? void 0 : _a.id) === message.id)
|
|
9770
9771
|
this.unselectMessage();
|
|
9771
9772
|
return [3 /*break*/, 6];
|
|
9772
9773
|
case 5:
|
|
9773
|
-
e_6 =
|
|
9774
|
+
e_6 = _e.sent();
|
|
9774
9775
|
this.handleBackendExceptionAsAlert(e_6, "Could not delete message: ");
|
|
9775
9776
|
return [3 /*break*/, 6];
|
|
9776
9777
|
case 6: return [2 /*return*/];
|
|
@@ -9781,22 +9782,22 @@
|
|
|
9781
9782
|
BantaCommentsComponent.prototype.editMessage = function (source, message, newText) {
|
|
9782
9783
|
return __awaiter(this, void 0, void 0, function () {
|
|
9783
9784
|
var e_7;
|
|
9784
|
-
return __generator(this, function (
|
|
9785
|
-
switch (
|
|
9785
|
+
return __generator(this, function (_e) {
|
|
9786
|
+
switch (_e.label) {
|
|
9786
9787
|
case 0:
|
|
9787
9788
|
if (!!this.user) return [3 /*break*/, 2];
|
|
9788
9789
|
return [4 /*yield*/, this.showSignIn()];
|
|
9789
9790
|
case 1:
|
|
9790
|
-
|
|
9791
|
+
_e.sent();
|
|
9791
9792
|
return [2 /*return*/];
|
|
9792
9793
|
case 2:
|
|
9793
|
-
|
|
9794
|
+
_e.trys.push([2, 4, , 5]);
|
|
9794
9795
|
return [4 /*yield*/, source.editMessage(message.id, newText)];
|
|
9795
9796
|
case 3:
|
|
9796
|
-
|
|
9797
|
+
_e.sent();
|
|
9797
9798
|
return [3 /*break*/, 5];
|
|
9798
9799
|
case 4:
|
|
9799
|
-
e_7 =
|
|
9800
|
+
e_7 = _e.sent();
|
|
9800
9801
|
this.handleBackendExceptionAsAlert(e_7, 'Could not edit this message: ');
|
|
9801
9802
|
return [2 /*return*/];
|
|
9802
9803
|
case 5:
|
|
@@ -9809,7 +9810,7 @@
|
|
|
9809
9810
|
};
|
|
9810
9811
|
BantaCommentsComponent.prototype.startEditing = function (message) {
|
|
9811
9812
|
return __awaiter(this, void 0, void 0, function () {
|
|
9812
|
-
return __generator(this, function (
|
|
9813
|
+
return __generator(this, function (_e) {
|
|
9813
9814
|
this.selectedMessage.transientState.editing = false;
|
|
9814
9815
|
message.transientState.editing = true;
|
|
9815
9816
|
return [2 /*return*/];
|
|
@@ -9819,23 +9820,23 @@
|
|
|
9819
9820
|
BantaCommentsComponent.prototype.saveEdit = function (message, text) {
|
|
9820
9821
|
return __awaiter(this, void 0, void 0, function () {
|
|
9821
9822
|
var e_8;
|
|
9822
|
-
return __generator(this, function (
|
|
9823
|
-
switch (
|
|
9823
|
+
return __generator(this, function (_e) {
|
|
9824
|
+
switch (_e.label) {
|
|
9824
9825
|
case 0:
|
|
9825
9826
|
if (!!this.user) return [3 /*break*/, 2];
|
|
9826
9827
|
return [4 /*yield*/, this.showSignIn()];
|
|
9827
9828
|
case 1:
|
|
9828
|
-
|
|
9829
|
+
_e.sent();
|
|
9829
9830
|
return [2 /*return*/];
|
|
9830
9831
|
case 2:
|
|
9831
|
-
|
|
9832
|
+
_e.trys.push([2, 4, , 5]);
|
|
9832
9833
|
return [4 /*yield*/, this.source.editMessage(message.id, text)];
|
|
9833
9834
|
case 3:
|
|
9834
|
-
|
|
9835
|
+
_e.sent();
|
|
9835
9836
|
message.transientState.editing = false;
|
|
9836
9837
|
return [3 /*break*/, 5];
|
|
9837
9838
|
case 4:
|
|
9838
|
-
e_8 =
|
|
9839
|
+
e_8 = _e.sent();
|
|
9839
9840
|
this.handleBackendExceptionAsAlert(e_8, "Could not edit message: ");
|
|
9840
9841
|
return [3 /*break*/, 5];
|
|
9841
9842
|
case 5: return [2 /*return*/];
|