@chat21/chat21-web-widget 5.0.55 → 5.0.56-rc.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/.github/workflows/build.yml +1 -0
- package/CHANGELOG.md +16 -0
- package/angular.json +6 -7
- package/package.json +5 -4
- package/src/app/app.component.html +1 -11
- package/src/app/app.component.scss +12 -13
- package/src/app/app.component.spec.ts +0 -2
- package/src/app/app.component.ts +29 -35
- package/src/app/app.module.ts +4 -5
- package/src/app/component/conversation-detail/conversation/conversation.component.html +1 -10
- package/src/app/component/conversation-detail/conversation/conversation.component.scss +5 -428
- package/src/app/component/conversation-detail/conversation/conversation.component.ts +23 -25
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.html +7 -66
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.scss +11 -81
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.spec.ts +0 -3
- package/src/app/component/conversation-detail/conversation-content/conversation-content.component.ts +6 -6
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.html +7 -32
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.scss +11 -11
- package/src/app/component/conversation-detail/conversation-footer/conversation-footer.component.ts +8 -8
- package/src/app/component/conversation-detail/conversation-header/conversation-header.component.html +4 -25
- package/src/app/component/conversation-detail/conversation-header/conversation-header.component.scss +5 -5
- package/src/app/component/conversation-detail/conversation-header/conversation-header.component.ts +4 -88
- package/src/app/component/conversation-detail/conversation-internal-frame/conversation-internal-frame.component.html +7 -16
- package/src/app/component/conversation-detail/conversation-internal-frame/conversation-internal-frame.component.ts +2 -26
- package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.html +1 -11
- package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.scss +5 -5
- package/src/app/component/conversation-detail/conversation-preview/conversation-preview.component.ts +2 -19
- package/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.html +10 -42
- package/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.scss +1 -2
- package/src/app/component/eyeeye-catcher-card/eyeeye-catcher-card.component.ts +2 -3
- package/src/app/component/form/form-builder/form-builder.component.html +0 -1
- package/src/app/component/form/form-builder/form-builder.component.scss +1 -1
- package/src/app/component/form/form-builder/form-builder.component.ts +4 -5
- package/src/app/component/form/inputs/form-checkbox/form-checkbox.component.scss +1 -2
- package/src/app/component/form/inputs/form-checkbox/form-checkbox.component.ts +2 -3
- package/src/app/component/form/inputs/form-label/form-label.component.ts +0 -1
- package/src/app/component/form/inputs/form-text/form-text.component.scss +3 -13
- package/src/app/component/form/inputs/form-text/form-text.component.ts +1 -2
- package/src/app/component/form/inputs/form-textarea/form-textarea.component.html +0 -13
- package/src/app/component/form/inputs/form-textarea/form-textarea.component.scss +4 -4
- package/src/app/component/form/inputs/form-textarea/form-textarea.component.ts +0 -10
- package/src/app/component/form/prechat-form/prechat-form.component.html +0 -2
- package/src/app/component/form/prechat-form/prechat-form.component.scss +2 -2
- package/src/app/component/form/prechat-form/prechat-form.component.ts +2 -2
- package/src/app/component/home/home.component.scss +7 -7
- package/src/app/component/home/home.component.ts +1 -4
- package/src/app/component/home-conversations/home-conversations.component.scss +7 -7
- package/src/app/component/home-conversations/home-conversations.component.ts +9 -12
- package/src/app/component/last-message/last-message.component.scss +4 -4
- package/src/app/component/last-message/last-message.component.ts +4 -7
- package/src/app/component/launcher-button/launcher-button.component.ts +3 -3
- package/src/app/component/list-all-conversations/list-all-conversations.component.scss +2 -2
- package/src/app/component/list-all-conversations/list-all-conversations.component.ts +3 -3
- package/src/app/component/list-conversations/list-conversations.component.html +1 -1
- package/src/app/component/list-conversations/list-conversations.component.scss +3 -3
- package/src/app/component/list-conversations/list-conversations.component.ts +3 -6
- package/src/app/component/menu-options/menu-options.component.html +1 -8
- package/src/app/component/menu-options/menu-options.component.scss +4 -4
- package/src/app/component/menu-options/menu-options.component.ts +1 -1
- package/src/app/component/message/bubble-message/bubble-message.component.html +3 -4
- package/src/app/component/message/bubble-message/bubble-message.component.scss +3 -3
- package/src/app/component/message/bubble-message/bubble-message.component.spec.ts +0 -2
- package/src/app/component/message/bubble-message/bubble-message.component.ts +10 -15
- package/src/app/component/message/buttons/action-button/action-button.component.scss +6 -6
- package/src/app/component/message/buttons/link-button/link-button.component.scss +7 -7
- package/src/app/component/message/buttons/text-button/text-button.component.scss +8 -8
- package/src/app/component/message/frame/frame.component.scss +1 -1
- package/src/app/component/message/frame/frame.component.ts +1 -1
- package/src/app/component/message/html/html.component.scss +4 -4
- package/src/app/component/message/html/html.component.ts +1 -2
- package/src/app/component/message/image/image.component.scss +1 -1
- package/src/app/component/message/image/image.component.ts +2 -3
- package/src/app/component/message/info-message/info-message.component.html +2 -1
- package/src/app/component/message/info-message/info-message.component.scss +6 -6
- package/src/app/component/message/like-unlike/like-unlike.component.scss +1 -1
- package/src/app/component/message/like-unlike/like-unlike.component.ts +2 -2
- package/src/app/component/message/text/text.component.scss +2 -2
- package/src/app/component/message/text/text.component.ts +1 -1
- package/src/app/component/message-attachment/message-attachment.component.ts +1 -1
- package/src/app/component/selection-department/selection-department.component.scss +6 -6
- package/src/app/component/selection-department/selection-department.component.ts +2 -2
- package/src/app/component/send-button/send-button.component.ts +1 -2
- package/src/app/component/star-rating-widget/star-rating-widget.component.scss +6 -6
- package/src/app/component/star-rating-widget/star-rating-widget.component.ts +2 -2
- package/src/app/pipe/date-ago.pipe.spec.ts +8 -0
- package/src/app/pipe/date-ago.pipe.ts +42 -0
- package/src/app/providers/app-config.service.ts +0 -1
- package/src/app/providers/global-settings.service.ts +3 -31
- package/src/app/providers/star-rating-widget.service.ts +4 -4
- package/src/app/providers/translator.service.ts +3 -11
- package/src/app/providers/waiting.service.ts +2 -2
- package/src/app/sass/_variables.scss +29 -26
- package/src/app/utils/globals.ts +4 -34
- package/src/app/utils/rules.ts +5 -7
- package/src/app/utils/utils.ts +47 -37
- package/src/assets/i18n/en.json +0 -2
- package/src/assets/i18n/es.json +0 -2
- package/src/assets/i18n/fr.json +0 -2
- package/src/assets/i18n/it.json +0 -2
- package/src/assets/twp/index.html +6 -60
- package/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts +15 -23
- package/src/chat21-core/providers/firebase/firebase-auth-service.ts +21 -20
- package/src/chat21-core/providers/firebase/firebase-conversation-handler.ts +15 -13
- package/src/chat21-core/providers/firebase/firebase-conversations-handler.ts +16 -23
- package/src/chat21-core/providers/firebase/firebase-groups-handler.ts +15 -11
- package/src/chat21-core/providers/firebase/firebase-image-repo.ts +13 -4
- package/src/chat21-core/providers/firebase/firebase-init-service.ts +3 -3
- package/src/chat21-core/providers/firebase/firebase-notifications.ts +11 -9
- package/src/chat21-core/providers/firebase/firebase-presence.service.ts +14 -11
- package/src/chat21-core/providers/firebase/firebase-typing.service.ts +17 -11
- package/src/chat21-core/providers/firebase/firebase-upload.service.ts +12 -9
- package/src/chat21-core/providers/localSessionStorage.ts +2 -15
- package/src/chat21-core/providers/mqtt/chat-service.ts +12 -2
- package/src/chat21-core/providers/mqtt/mqtt-archivedconversations-handler.ts +1 -34
- package/src/chat21-core/providers/mqtt/mqtt-auth-service.ts +4 -6
- package/src/chat21-core/providers/mqtt/mqtt-conversations-handler.ts +1 -11
- package/src/chat21-core/providers/mqtt/mqtt-notifications.ts +13 -7
- package/src/chat21-core/providers/mqtt/mqtt-presence.service.ts +3 -3
- package/src/chat21-core/providers/mqtt/mqtt-typing.service.ts +3 -3
- package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts +0 -1
- package/src/chat21-core/utils/user-typing/user-typing.component.scss +3 -3
- package/src/chat21-core/utils/utils.ts +47 -163
- package/src/launch.js +42 -12
- package/src/models/message.ts +0 -23
- package/src/test-new.html +0 -6
- package/src/app/providers/settings-saver.service.spec.ts +0 -17
- package/src/app/providers/settings-saver.service.ts +0 -56
- package/src/app/providers/storage.service.spec.ts +0 -16
- package/src/app/providers/storage.service.ts +0 -220
- package/src/app/utils/translations.ts +0 -122
package/src/app/utils/globals.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Injectable } from '@angular/core';
|
|
2
|
-
import { environment } from '../../environments/environment';
|
|
3
2
|
import { BehaviorSubject } from 'rxjs';
|
|
3
|
+
import { environment } from '../../environments/environment';
|
|
4
4
|
|
|
5
5
|
/** CONSTANTS */
|
|
6
6
|
import { CHANNEL_TYPE_GROUP } from 'src/chat21-core/utils/constants';
|
|
7
7
|
|
|
8
8
|
/** MODELS */
|
|
9
|
+
import { DepartmentModel } from 'src/models/department';
|
|
9
10
|
import { ProjectModel } from 'src/models/project';
|
|
10
11
|
import { UserAgent } from 'src/models/userAgent';
|
|
11
|
-
import { DepartmentModel } from 'src/models/department';
|
|
12
12
|
|
|
13
13
|
/** UTILS FUNCTIONS */
|
|
14
14
|
import { avatarPlaceholder, detectIfIsMobile, getParameterByName, setColorFromString } from 'src/app/utils/utils';
|
|
@@ -21,17 +21,13 @@ import { Rule } from 'src/models/rule';
|
|
|
21
21
|
})
|
|
22
22
|
export class Globals {
|
|
23
23
|
|
|
24
|
-
obsObjChanged = new BehaviorSubject<any>(null);
|
|
25
|
-
obsIsOpen = new BehaviorSubject<boolean>(null);
|
|
26
|
-
|
|
27
24
|
BASE_LOCATION = 'https://widget.tiledesk.com/v2';
|
|
28
25
|
POWERED_BY ='<a tabindex="-1" target="_blank" href="http://www.tiledesk.com/?utm_source=widget"><img src="https://support-pre.tiledesk.com/dashboard/assets/img/logos/tiledesk-logo_new_gray.svg"/></a>'
|
|
29
26
|
DEFAULT_LOGO_CHAT = '/assets/images/tiledesk_logo_white_small.svg';
|
|
30
|
-
WIDGET_TITLE = 'Tiledesk';
|
|
31
27
|
|
|
32
28
|
// ============ BEGIN: SET FUNCTION BY UTILS ==============//
|
|
33
29
|
// getParameterByName = getParameterByName;
|
|
34
|
-
convertColorToRGBA = convertColorToRGBA;
|
|
30
|
+
// convertColorToRGBA = convertColorToRGBA;
|
|
35
31
|
// ============ BEGIN: SET INTERNAL PARAMETERS ==============//
|
|
36
32
|
|
|
37
33
|
project = new ProjectModel();
|
|
@@ -43,11 +39,9 @@ export class Globals {
|
|
|
43
39
|
isLogged: boolean;
|
|
44
40
|
soundEnabled: boolean;
|
|
45
41
|
BUILD_VERSION: String;
|
|
46
|
-
filterSystemMsg: boolean; /** se è true i messaggi inviati da system non vengono visualizzati */
|
|
47
42
|
baseLocation: string;
|
|
48
43
|
availableAgents: Array<UserAgent> = [];
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
|
|
51
45
|
attributes: any;
|
|
52
46
|
preChatFormJson: any; // ******* new ********
|
|
53
47
|
token: string;
|
|
@@ -70,20 +64,16 @@ export class Globals {
|
|
|
70
64
|
// areAgentsAvailable = false;
|
|
71
65
|
areAgentsAvailableText: string;
|
|
72
66
|
availableAgentsStatus = false; // indica quando è impostato lo stato degli agenti nel subscribe
|
|
73
|
-
signInWithCustomToken: boolean;
|
|
74
67
|
displayEyeCatcherCard: string;
|
|
75
68
|
|
|
76
69
|
firstOpen = true;
|
|
77
70
|
departmentID = null;
|
|
78
71
|
privacyApproved = false;
|
|
79
|
-
startedAt = new Date();
|
|
80
72
|
|
|
81
73
|
// ============ BEGIN: LABELS ==============//
|
|
82
74
|
LABEL_TU: string;
|
|
83
75
|
LABEL_PLACEHOLDER: string;
|
|
84
76
|
LABEL_START_NW_CONV: string;
|
|
85
|
-
LABEL_FIRST_MSG: string;
|
|
86
|
-
LABEL_FIRST_MSG_NO_AGENTS: string;
|
|
87
77
|
LABEL_SELECT_TOPIC: string;
|
|
88
78
|
LABEL_COMPLETE_FORM: string;
|
|
89
79
|
LABEL_FIELD_NAME: string;
|
|
@@ -188,9 +178,6 @@ export class Globals {
|
|
|
188
178
|
showLogoutOption: boolean;
|
|
189
179
|
supportMode: boolean;
|
|
190
180
|
|
|
191
|
-
online_msg: string;
|
|
192
|
-
offline_msg: string;
|
|
193
|
-
|
|
194
181
|
customAttributes: any;
|
|
195
182
|
showAttachmentButton: boolean;
|
|
196
183
|
showAllConversations: boolean;
|
|
@@ -232,7 +219,6 @@ export class Globals {
|
|
|
232
219
|
*/
|
|
233
220
|
initDefafultParameters() {
|
|
234
221
|
this.globalsParameters = {};
|
|
235
|
-
this.filterSystemMsg = true;
|
|
236
222
|
|
|
237
223
|
let wContext: any = window;
|
|
238
224
|
if (window.frameElement && window.frameElement.getAttribute('tiledesk_context') === 'parent') {
|
|
@@ -406,9 +392,6 @@ export class Globals {
|
|
|
406
392
|
|
|
407
393
|
this.showLogoutOption = false;
|
|
408
394
|
|
|
409
|
-
this.offline_msg = this.LABEL_FIRST_MSG_NO_AGENTS;
|
|
410
|
-
this.online_msg = this.LABEL_FIRST_MSG;
|
|
411
|
-
|
|
412
395
|
this.isOpenNewMessage = false;
|
|
413
396
|
this.showAttachmentButton = true;
|
|
414
397
|
this.showAllConversations = true;
|
|
@@ -443,11 +426,6 @@ export class Globals {
|
|
|
443
426
|
// this.parameters['BUILD_VERSION'] = 'v.' + environment.version;
|
|
444
427
|
// this.parameters.push({'BUILD_VERSION': 'v.' + environment.version});
|
|
445
428
|
|
|
446
|
-
this.filterSystemMsg = true;
|
|
447
|
-
/** ???? scolpito in MessagingService. se è true i messaggi inviati da system non vengono visualizzati */
|
|
448
|
-
// this.parameters['filterSystemMsg'] = true;
|
|
449
|
-
// this.parameters.push({'filterSystemMsg': true});
|
|
450
|
-
|
|
451
429
|
this.soundEnabled = true;
|
|
452
430
|
// this.parameters['soundEnabled'] = true;
|
|
453
431
|
// this.parameters.push({'soundEnabled': true});
|
|
@@ -459,10 +437,6 @@ export class Globals {
|
|
|
459
437
|
this.isOpenMenuOptions = false;
|
|
460
438
|
// this.parameters['isOpenMenuOptions'] = false;
|
|
461
439
|
// this.parameters.push({'isOpenMenuOptions': false});
|
|
462
|
-
/** open/close menu options */
|
|
463
|
-
this.signInWithCustomToken = false;
|
|
464
|
-
// this.parameters['signInWithCustomToken'] = false;
|
|
465
|
-
// this.parameters.push({'signInWithCustomToken': false});
|
|
466
440
|
|
|
467
441
|
this.displayEyeCatcherCard = 'none';
|
|
468
442
|
// this.parameters['displayEyeCatcherCard'] = 'none';
|
|
@@ -622,7 +596,6 @@ export class Globals {
|
|
|
622
596
|
this.isOpen = val;
|
|
623
597
|
this.setParentBodyStyleMobile(val, this.isMobile)
|
|
624
598
|
this.setElementStyle(val)
|
|
625
|
-
this.obsIsOpen.next(val);
|
|
626
599
|
}
|
|
627
600
|
|
|
628
601
|
/**
|
|
@@ -634,9 +607,6 @@ export class Globals {
|
|
|
634
607
|
// storage = true;
|
|
635
608
|
this[key] = val;
|
|
636
609
|
const obj = {'key': key, 'val': val};
|
|
637
|
-
if (storage === true) {
|
|
638
|
-
this.obsObjChanged.next(obj);
|
|
639
|
-
}
|
|
640
610
|
}
|
|
641
611
|
|
|
642
612
|
/**
|
package/src/app/utils/rules.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
1
2
|
import { AppStorageService } from 'src/chat21-core/providers/abstract/app-storage.service';
|
|
2
|
-
import { Globals } from './globals';
|
|
3
|
-
import { UserModel } from './../../chat21-core/models/user';
|
|
4
|
-
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
5
3
|
import { LoggerService } from 'src/chat21-core/providers/abstract/logger.service';
|
|
6
|
-
import {
|
|
4
|
+
import { LoggerInstance } from 'src/chat21-core/providers/logger/loggerInstance';
|
|
7
5
|
import { TiledeskRequestsService } from 'src/chat21-core/providers/tiledesk/tiledesk-requests.service';
|
|
8
|
-
import { Inject, Injectable } from '@angular/core';
|
|
9
|
-
import { IRules, Rule } from 'src/models/rule';
|
|
10
6
|
import { getDateDifference } from 'src/chat21-core/utils/utils';
|
|
7
|
+
import { Rule } from 'src/models/rule';
|
|
8
|
+
import { UserModel } from './../../chat21-core/models/user';
|
|
9
|
+
import { Globals } from './globals';
|
|
11
10
|
|
|
12
11
|
|
|
13
12
|
@Injectable({
|
|
@@ -60,7 +59,6 @@ export class Rules {
|
|
|
60
59
|
message[0]['message'].sourcePage = this.g.attributes['sourcePage']
|
|
61
60
|
message[0]['message'].language = this.g.lang
|
|
62
61
|
message[0]['message'].departmentid = this.g.attributes.departmentId
|
|
63
|
-
console.log('message[0]', message[0]['message'])
|
|
64
62
|
this.tiledeskRequestsService.sendMessageToRequest(this.request_id, this.tiledeskToken, message[0]['message'])
|
|
65
63
|
}
|
|
66
64
|
}
|
package/src/app/utils/utils.ts
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
import * as moment from 'moment';
|
|
2
|
-
import 'moment/locale/it.js';
|
|
3
|
-
|
|
4
|
-
// firebase
|
|
5
|
-
import 'firebase/storage';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
// tslint:disable-next-line:max-line-length
|
|
9
1
|
import {
|
|
10
2
|
IMG_PROFILE_BOT,
|
|
11
3
|
IMG_PROFILE_DEFAULT,
|
|
@@ -25,26 +17,26 @@ import { environment } from '../../environments/environment';
|
|
|
25
17
|
* giorno della settimana (lunedì, martedì, ecc)
|
|
26
18
|
* @deprecated
|
|
27
19
|
*/
|
|
28
|
-
export function setHeaderDate(timestamp): string {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
20
|
+
// export function setHeaderDate(timestamp): string {
|
|
21
|
+
// const date = new Date(timestamp);
|
|
22
|
+
// const now: Date = new Date();
|
|
23
|
+
// let labelDays = '';
|
|
24
|
+
// if (now.getFullYear() !== date.getFullYear()) {
|
|
25
|
+
// labelDays = date.getDay() + '/' + date.getMonth() + '/' + date.getFullYear();
|
|
26
|
+
// } else if (now.getMonth() !== date.getMonth()) {
|
|
27
|
+
// labelDays = date.getDay() + '/' + date.getMonth() + '/' + date.getFullYear();
|
|
28
|
+
// } else if (now.getDay() === date.getDay()) {
|
|
29
|
+
// labelDays = LABEL_TODAY;
|
|
30
|
+
// } else if (now.getDay() - date.getDay() === 1) {
|
|
31
|
+
// labelDays = LABEL_TOMORROW;
|
|
32
|
+
// } else {
|
|
33
|
+
// labelDays = convertDayToString(date.getDay());
|
|
34
|
+
// }
|
|
35
|
+
// // se le date sono diverse o la data di riferimento non è impostata
|
|
36
|
+
// // ritorna la data calcolata
|
|
37
|
+
// // altrimenti torna null
|
|
38
|
+
// return labelDays;
|
|
39
|
+
// }
|
|
48
40
|
|
|
49
41
|
export function supports_html5_storage() {
|
|
50
42
|
try {
|
|
@@ -228,15 +220,6 @@ export function setColorFromString(str: string) {
|
|
|
228
220
|
return arrayBckColor[num];
|
|
229
221
|
}
|
|
230
222
|
|
|
231
|
-
export function getFromNow(windowContext, timestamp) {
|
|
232
|
-
let browserLang = windowContext.navigator.language;
|
|
233
|
-
if (this.g.lang && this.g.lang !== '') {
|
|
234
|
-
browserLang = this.g.lang;
|
|
235
|
-
}
|
|
236
|
-
moment.locale(browserLang);
|
|
237
|
-
return moment.unix(timestamp).fromNow();
|
|
238
|
-
}
|
|
239
|
-
|
|
240
223
|
export function detectIfIsMobile(windowContext) {
|
|
241
224
|
let isMobile = false;
|
|
242
225
|
if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile|mobile|CriOS/i.test(windowContext.navigator.userAgent))
|
|
@@ -246,6 +229,33 @@ export function detectIfIsMobile(windowContext) {
|
|
|
246
229
|
return isMobile;
|
|
247
230
|
}
|
|
248
231
|
|
|
232
|
+
/**
|
|
233
|
+
* definitely not the best way to findout if there is a mobile browser
|
|
234
|
+
* @returns {any}
|
|
235
|
+
*/
|
|
236
|
+
export function deviceOS() {
|
|
237
|
+
var useragent = navigator.userAgent;
|
|
238
|
+
if(useragent.match(/Android/i)) {
|
|
239
|
+
return 'android';
|
|
240
|
+
} else if(useragent.match(/webOS/i)) {
|
|
241
|
+
return 'webos';
|
|
242
|
+
} else if(useragent.match(/iPhone/i)) {
|
|
243
|
+
return 'iphone';
|
|
244
|
+
} else if(useragent.match(/iPod/i)) {
|
|
245
|
+
return 'ipod';
|
|
246
|
+
} else if(useragent.match(/iPad/i)) {
|
|
247
|
+
return 'ipad';
|
|
248
|
+
} else if(useragent.match(/Windows Phone/i)) {
|
|
249
|
+
return 'windows phone';
|
|
250
|
+
} else if(useragent.match(/SymbianOS/i)) {
|
|
251
|
+
return 'symbian';
|
|
252
|
+
} else if(useragent.match(/RIM/i) || useragent.match(/BB/i)) {
|
|
253
|
+
return 'blackberry';
|
|
254
|
+
} else {
|
|
255
|
+
return false;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
249
259
|
export function convertColorToRGBA(color, opacity) {
|
|
250
260
|
let result = color;
|
|
251
261
|
// console.log('convertColorToRGBA' , color, opacity);
|
package/src/assets/i18n/en.json
CHANGED
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
"LABEL_PLACEHOLDER": "type your message..",
|
|
4
4
|
"LABEL_START_NW_CONV": "New conversation",
|
|
5
5
|
"LABEL_WHATSAPP": "Message us",
|
|
6
|
-
"LABEL_FIRST_MSG": "Describe shortly your problem, you will be contacted by an agent.",
|
|
7
|
-
"LABEL_FIRST_MSG_NO_AGENTS": "🤔 All operators are offline at the moment. You can anyway describe your problem. It will be assigned to the support team who will answer you as soon as possible.",
|
|
8
6
|
"LABEL_SELECT_TOPIC": "Select a topic",
|
|
9
7
|
"LABEL_COMPLETE_FORM": "Complete the form to start a conversation with the next available agent.",
|
|
10
8
|
"LABEL_FIELD_NAME": "Name",
|
package/src/assets/i18n/es.json
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
"LABEL_TU": "",
|
|
3
3
|
"LABEL_PLACEHOLDER": "escribe tu mensaje..",
|
|
4
4
|
"LABEL_START_NW_CONV": "Nueva conversación",
|
|
5
|
-
"LABEL_FIRST_MSG": "Describa brevemente su problema, un agente lo contactará.",
|
|
6
|
-
"LABEL_FIRST_MSG_NO_AGENTS": "🤔 Todos los operadores están desconectados en este momento. De todos modos puedes describir tu problema. Se asignará al equipo de soporte que le responderá lo antes posible.",
|
|
7
5
|
"LABEL_SELECT_TOPIC": "Elige un tema",
|
|
8
6
|
"LABEL_COMPLETE_FORM": "Complete el formulario para iniciar una conversación con el próximo agente disponible.",
|
|
9
7
|
"LABEL_FIELD_NAME": "Nombre",
|
package/src/assets/i18n/fr.json
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
"LABEL_TU": "",
|
|
3
3
|
"LABEL_PLACEHOLDER": "Écrivez votre question ...",
|
|
4
4
|
"LABEL_START_NW_CONV": "Nouvelle conversation",
|
|
5
|
-
"LABEL_FIRST_MSG": "Décrivez brièvement votre problème, nous vous mettrons en relation avec un opérateur spécialisé.",
|
|
6
|
-
"LABEL_FIRST_MSG_NO_AGENTS": "🤔 Tous les opérateurs sont actuellement hors ligne. Vous pouvez toujours décrire votre problème. Il sera attribué à l'équipe d'assistance qui vous répondra dans les plus brefs délais.",
|
|
7
5
|
"LABEL_SELECT_TOPIC": "Sélectionnez un sujet",
|
|
8
6
|
"LABEL_COMPLETE_FORM": "Remplissez le formulaire pour démarrer une conversation avec le prochain agent disponible.",
|
|
9
7
|
"LABEL_FIELD_NAME": "Prenom",
|
package/src/assets/i18n/it.json
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
"LABEL_TU": "",
|
|
3
3
|
"LABEL_PLACEHOLDER": "Scrivi la tua domanda...",
|
|
4
4
|
"LABEL_START_NW_CONV": "Nuova conversazione",
|
|
5
|
-
"LABEL_FIRST_MSG": "Descrivi sinteticamente il tuo problema, ti metteremo in contatto con un operatore specializzato.",
|
|
6
|
-
"LABEL_FIRST_MSG_NO_AGENTS": "🤔 Tutti gli operatori sono offline al momento.Puoi comunque descrivere il tuo problema. Sarà assegnato al team di supporto che ti risponderà appena possibile.",
|
|
7
5
|
"LABEL_SELECT_TOPIC": "Seleziona un argomento",
|
|
8
6
|
"LABEL_COMPLETE_FORM": "Completa il form per iniziare una conversazione con il prossimo agente disponibile.",
|
|
9
7
|
"LABEL_FIELD_NAME": "Nome",
|
|
@@ -180,43 +180,6 @@
|
|
|
180
180
|
|
|
181
181
|
</style>
|
|
182
182
|
|
|
183
|
-
<!-- <script type="text/javascript">
|
|
184
|
-
|
|
185
|
-
// redirect to mobile version
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* definitely not the best way to findout if there is a mobile browser
|
|
189
|
-
* @returns {any}
|
|
190
|
-
*/
|
|
191
|
-
function deviceOS() {
|
|
192
|
-
var useragent = navigator.userAgent;
|
|
193
|
-
if(useragent.match(/Android/i)) {
|
|
194
|
-
return 'android';
|
|
195
|
-
} else if(useragent.match(/webOS/i)) {
|
|
196
|
-
return 'webos';
|
|
197
|
-
} else if(useragent.match(/iPhone/i)) {
|
|
198
|
-
return 'iphone';
|
|
199
|
-
} else if(useragent.match(/iPod/i)) {
|
|
200
|
-
return 'ipod';
|
|
201
|
-
} else if(useragent.match(/iPad/i)) {
|
|
202
|
-
return 'ipad';
|
|
203
|
-
} else if(useragent.match(/Windows Phone/i)) {
|
|
204
|
-
return 'windows phone';
|
|
205
|
-
} else if(useragent.match(/SymbianOS/i)) {
|
|
206
|
-
return 'symbian';
|
|
207
|
-
} else if(useragent.match(/RIM/i) || useragent.match(/BB/i)) {
|
|
208
|
-
return 'blackberry';
|
|
209
|
-
} else {
|
|
210
|
-
return false;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
if (deviceOS()) {
|
|
215
|
-
var frameEl = document.getElementById('frame');
|
|
216
|
-
location.href = "";
|
|
217
|
-
}
|
|
218
|
-
</script> -->
|
|
219
|
-
|
|
220
183
|
<meta property="og:title" content="Try Tiledesk now!" />
|
|
221
184
|
<meta property="og:description" content="Qualify your leads to increase your sales faster. It's really easy to do it with the Tiledesk conversational form builder" />
|
|
222
185
|
<meta property="og:image" content="https://tiledesk.com/wp-content/uploads/2022/12/6029654-02-min.png" />
|
|
@@ -227,20 +190,7 @@
|
|
|
227
190
|
<script defer="" src="./tiledesk_widget_files/jquery.min.js"></script>
|
|
228
191
|
<script defer="" src="./tiledesk_widget_files/bootstrap.min.js"></script>
|
|
229
192
|
|
|
230
|
-
<!-- <script type="application/javascript">
|
|
231
|
-
window.tiledeskSettings = {
|
|
232
|
-
marginX: "100px",
|
|
233
|
-
marginY: "50px"
|
|
234
|
-
};
|
|
235
|
-
(function(d, s, id) {
|
|
236
|
-
var js, fjs = d.getElementsByTagName(s)[0];
|
|
237
|
-
if (d.getElementById(id)) return;
|
|
238
|
-
js = d.createElement(s); js.id = id; //js.async=!0;
|
|
239
|
-
js.src = "../../launch.js";
|
|
240
|
-
fjs.parentNode.insertBefore(js, fjs);
|
|
241
|
-
}(document, 'script', 'tiledesk-jssdk'));
|
|
242
193
|
|
|
243
|
-
</script> -->
|
|
244
194
|
<script type="application/javascript">
|
|
245
195
|
window.tiledeskSettings = {
|
|
246
196
|
marginX: "100px",
|
|
@@ -288,13 +238,14 @@
|
|
|
288
238
|
}
|
|
289
239
|
}, 1000);
|
|
290
240
|
|
|
241
|
+
setTimeout(() => {
|
|
242
|
+
document.getElementById("preloader").style.display = "none";
|
|
243
|
+
}, 1000);
|
|
244
|
+
|
|
291
245
|
});
|
|
292
246
|
|
|
293
247
|
window.Tiledesk('onInit', function(event_data) {
|
|
294
248
|
console.log("onInit Tiledesk FN", event_data);
|
|
295
|
-
setTimeout(() => {
|
|
296
|
-
document.getElementById("preloader").style.display = "none";
|
|
297
|
-
}, 1000);
|
|
298
249
|
//open widget after 3s if is closed
|
|
299
250
|
// setTimeout(() => {
|
|
300
251
|
// if(event_data && event_data.detail && event_data.detail.global && !event_data.detail.global.isOpen){
|
|
@@ -305,10 +256,6 @@
|
|
|
305
256
|
|
|
306
257
|
window.Tiledesk('onAuthStateChanged', function(event_data) {
|
|
307
258
|
console.log("AUTHENTICATED!", event_data);
|
|
308
|
-
// if(event_data.detail.isLogged){
|
|
309
|
-
// console.log("isLogged!!!!", event_data);
|
|
310
|
-
// window.Tiledesk('show')
|
|
311
|
-
// }
|
|
312
259
|
});
|
|
313
260
|
</script>
|
|
314
261
|
|
|
@@ -548,9 +495,9 @@
|
|
|
548
495
|
</a>
|
|
549
496
|
|
|
550
497
|
<!-- whatsapp -->
|
|
551
|
-
|
|
498
|
+
<a onclick="shareOnWhatsapp()" style="cursor: pointer">
|
|
552
499
|
<img src="./tiledesk_widget_files/whatsapp.png" alt="Whatsapp">
|
|
553
|
-
</a>
|
|
500
|
+
</a>
|
|
554
501
|
|
|
555
502
|
</div>
|
|
556
503
|
</div>
|
|
@@ -597,7 +544,6 @@
|
|
|
597
544
|
<link href="./tiledesk_widget_files/bootstrap.min.css" rel="stylesheet" type="text/css">
|
|
598
545
|
<!-- <link href="./tiledesk_widget_files/font-awesome.min.css" rel="stylesheet" type="text/css"> -->
|
|
599
546
|
<link href="./tiledesk_widget_files/website-poly.min.css" rel="stylesheet" type="text/css">
|
|
600
|
-
<!-- <link href="./tiledesk_widget_files/css" rel="stylesheet" type="text/css"> -->
|
|
601
547
|
</div>
|
|
602
548
|
</body>
|
|
603
549
|
</html>
|
|
@@ -3,18 +3,14 @@ import { BehaviorSubject, Subscription } from 'rxjs';
|
|
|
3
3
|
|
|
4
4
|
// firebase
|
|
5
5
|
// import * as firebase from 'firebase/app';
|
|
6
|
-
import firebase from 'firebase/app';
|
|
7
|
-
import 'firebase/messaging';
|
|
8
|
-
import 'firebase/database';
|
|
9
|
-
import 'firebase/auth';
|
|
10
|
-
import 'firebase/storage';
|
|
6
|
+
// import firebase from 'firebase/app';
|
|
11
7
|
|
|
12
8
|
// models
|
|
13
9
|
import { ConversationModel } from '../../models/conversation';
|
|
14
10
|
|
|
15
11
|
// utils
|
|
16
12
|
import { avatarPlaceholder, getColorBck } from '../../utils/utils-user';
|
|
17
|
-
import { compareValues,
|
|
13
|
+
import { compareValues, searchIndexInArrayForUid, archivedConversationsPathForUserId, isGroup } from '../../utils/utils';
|
|
18
14
|
import { ArchivedConversationsHandlerService } from '../abstract/archivedconversations-handler.service';
|
|
19
15
|
import { LoggerService } from '../abstract/logger.service';
|
|
20
16
|
import { LoggerInstance } from '../logger/loggerInstance';
|
|
@@ -44,10 +40,12 @@ export class FirebaseArchivedConversationsHandler extends ArchivedConversationsH
|
|
|
44
40
|
private translationMap: Map<string, string>;
|
|
45
41
|
private isConversationClosingMap: Map<string, boolean>;
|
|
46
42
|
private logger:LoggerService = LoggerInstance.getInstance()
|
|
47
|
-
private ref: firebase.database.Query;
|
|
43
|
+
// private ref: firebase.database.Query;
|
|
44
|
+
|
|
48
45
|
|
|
49
46
|
private subscribe: any;
|
|
50
|
-
|
|
47
|
+
private firebase: any;
|
|
48
|
+
private ref: any;
|
|
51
49
|
constructor(
|
|
52
50
|
//public databaseProvider: DatabaseProvider
|
|
53
51
|
) {
|
|
@@ -57,12 +55,17 @@ export class FirebaseArchivedConversationsHandler extends ArchivedConversationsH
|
|
|
57
55
|
/**
|
|
58
56
|
* inizializzo conversations handler
|
|
59
57
|
*/
|
|
60
|
-
initialize(tenant: string,userId: string,translationMap: Map<string, string>) {
|
|
58
|
+
async initialize(tenant: string,userId: string,translationMap: Map<string, string>) {
|
|
61
59
|
this.tenant = tenant;
|
|
62
60
|
this.loggedUserId = userId;
|
|
63
61
|
this.translationMap = translationMap;
|
|
64
62
|
this.archivedConversations = [];
|
|
65
63
|
this.isConversationClosingMap = new Map();
|
|
64
|
+
|
|
65
|
+
const { default: firebase} = await import("firebase/app");
|
|
66
|
+
await Promise.all([import("firebase/database"), import("firebase/auth")]);
|
|
67
|
+
this.firebase = firebase
|
|
68
|
+
this.ref = this.firebase.database['Query'];
|
|
66
69
|
}
|
|
67
70
|
|
|
68
71
|
/**
|
|
@@ -94,7 +97,7 @@ export class FirebaseArchivedConversationsHandler extends ArchivedConversationsH
|
|
|
94
97
|
const that = this;
|
|
95
98
|
const urlNodeFirebase = archivedConversationsPathForUserId(this.tenant, this.loggedUserId);
|
|
96
99
|
this.logger.debug('[FIREBASEArchivedConversationsHandlerSERVICE] SubscribeToConversations conversations::ARCHIVED urlNodeFirebase', urlNodeFirebase)
|
|
97
|
-
this.ref = firebase.database().ref(urlNodeFirebase).orderByChild('timestamp').limitToLast(200);
|
|
100
|
+
this.ref = this.firebase.database().ref(urlNodeFirebase).orderByChild('timestamp').limitToLast(200);
|
|
98
101
|
this.ref.on('child_changed', (childSnapshot) => {
|
|
99
102
|
that.changed(childSnapshot);
|
|
100
103
|
});
|
|
@@ -134,7 +137,7 @@ export class FirebaseArchivedConversationsHandler extends ArchivedConversationsH
|
|
|
134
137
|
const urlUpdate = archivedConversationsPathForUserId(this.tenant, this.loggedUserId) + '/' + conversationrecipient;
|
|
135
138
|
const update = {};
|
|
136
139
|
update['/is_new'] = false;
|
|
137
|
-
firebase.database().ref(urlUpdate).update(update);
|
|
140
|
+
this.firebase.database().ref(urlUpdate).update(update);
|
|
138
141
|
}
|
|
139
142
|
|
|
140
143
|
|
|
@@ -173,7 +176,7 @@ export class FirebaseArchivedConversationsHandler extends ArchivedConversationsH
|
|
|
173
176
|
} else {
|
|
174
177
|
const urlNodeFirebase = archivedConversationsPathForUserId(this.tenant, this.loggedUserId) // + '/' + conversationId;
|
|
175
178
|
this.logger.debug('[FIREBASEArchivedConversationsHandlerSERVICE] urlNodeFirebase conversationDetail *****', urlNodeFirebase, conversationId)
|
|
176
|
-
const firebaseMessages = firebase.database().ref(urlNodeFirebase);
|
|
179
|
+
const firebaseMessages = this.firebase.database().ref(urlNodeFirebase);
|
|
177
180
|
// if(this.subscribe){
|
|
178
181
|
// this.logger.log('[FIREBASEArchivedConversationsHandlerSERVICE] getConversationDetail ALREADY SUBSCRIBED')
|
|
179
182
|
// return;
|
|
@@ -363,17 +366,6 @@ export class FirebaseArchivedConversationsHandler extends ArchivedConversationsH
|
|
|
363
366
|
return status;
|
|
364
367
|
}
|
|
365
368
|
|
|
366
|
-
/**
|
|
367
|
-
* calcolo il tempo trascorso da ora al timestamp passato
|
|
368
|
-
* @param timestamp
|
|
369
|
-
*/
|
|
370
|
-
private getTimeLastMessage(timestamp: string) {
|
|
371
|
-
const timestampNumber = parseInt(timestamp, 10) / 1000;
|
|
372
|
-
const time = getFromNow(timestampNumber);
|
|
373
|
-
return time;
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
|
|
377
369
|
/**
|
|
378
370
|
* check if the conversations is valid or not
|
|
379
371
|
*/
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
+
import { environment } from 'src/environments/environment';
|
|
1
2
|
import { Injectable } from '@angular/core';
|
|
2
3
|
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
|
3
4
|
import { BehaviorSubject } from 'rxjs';
|
|
4
5
|
|
|
5
6
|
// firebase
|
|
6
|
-
import firebase from 'firebase/app';
|
|
7
|
-
import 'firebase/messaging';
|
|
8
|
-
import 'firebase/database';
|
|
9
|
-
import 'firebase/auth';
|
|
10
|
-
import 'firebase/storage';
|
|
7
|
+
// import firebase from 'firebase/app';
|
|
11
8
|
|
|
12
9
|
// services
|
|
13
10
|
import { MessagingAuthService } from '../abstract/messagingAuth.service';
|
|
@@ -35,6 +32,7 @@ export class FirebaseAuthService extends MessagingAuthService {
|
|
|
35
32
|
// private imageRepo: ImageRepoService = new FirebaseImageRepoService();
|
|
36
33
|
|
|
37
34
|
private firebaseToken: string;
|
|
35
|
+
private firebase: any;
|
|
38
36
|
private logger:LoggerService = LoggerInstance.getInstance()
|
|
39
37
|
constructor(
|
|
40
38
|
public http: HttpClient
|
|
@@ -45,14 +43,16 @@ export class FirebaseAuthService extends MessagingAuthService {
|
|
|
45
43
|
/**
|
|
46
44
|
*
|
|
47
45
|
*/
|
|
48
|
-
initialize() {
|
|
46
|
+
async initialize() {
|
|
49
47
|
this.SERVER_BASE_URL = this.getBaseUrl();
|
|
50
48
|
this.URL_TILEDESK_CREATE_CUSTOM_TOKEN = this.SERVER_BASE_URL + 'chat21/firebase/auth/createCustomToken';
|
|
51
49
|
this.logger.debug('[FIREBASEAuthSERVICE] - initialize URL_TILEDESK_CREATE_CUSTOM_TOKEN ', this.URL_TILEDESK_CREATE_CUSTOM_TOKEN)
|
|
52
|
-
// this.URL_TILEDESK_SIGNIN = this.SERVER_BASE_URL + 'auth/signin';
|
|
53
|
-
// this.URL_TILEDESK_SIGNIN_ANONYMOUSLY = this.SERVER_BASE_URL + 'auth/signinAnonymously'
|
|
54
|
-
// this.URL_TILEDESK_SIGNIN_WITH_CUSTOM_TOKEN = this.SERVER_BASE_URL + 'auth/signinWithCustomToken';
|
|
55
50
|
// this.checkIsAuth();
|
|
51
|
+
|
|
52
|
+
const { default: firebase} = await import("firebase/app");
|
|
53
|
+
await Promise.all([import("firebase/auth")]);
|
|
54
|
+
this.firebase = firebase
|
|
55
|
+
|
|
56
56
|
this.onAuthStateChanged();
|
|
57
57
|
}
|
|
58
58
|
|
|
@@ -93,7 +93,8 @@ export class FirebaseAuthService extends MessagingAuthService {
|
|
|
93
93
|
*/
|
|
94
94
|
onAuthStateChanged() {
|
|
95
95
|
const that = this;
|
|
96
|
-
|
|
96
|
+
|
|
97
|
+
this.firebase.auth().onAuthStateChanged(user => {
|
|
97
98
|
this.logger.debug('[FIREBASEAuthSERVICE] onAuthStateChanged', user)
|
|
98
99
|
if (!user) {
|
|
99
100
|
this.logger.debug('[FIREBASEAuthSERVICE] 1 - PUBLISH OFFLINE to chat-manager')
|
|
@@ -114,24 +115,24 @@ export class FirebaseAuthService extends MessagingAuthService {
|
|
|
114
115
|
let firebasePersistence;
|
|
115
116
|
switch (this.getPersistence()) {
|
|
116
117
|
case 'SESSION': {
|
|
117
|
-
firebasePersistence = firebase.auth.Auth.Persistence.SESSION;
|
|
118
|
+
firebasePersistence = this.firebase.auth.Auth.Persistence.SESSION;
|
|
118
119
|
break;
|
|
119
120
|
}
|
|
120
121
|
case 'LOCAL': {
|
|
121
|
-
firebasePersistence = firebase.auth.Auth.Persistence.LOCAL;
|
|
122
|
+
firebasePersistence = this.firebase.auth.Auth.Persistence.LOCAL;
|
|
122
123
|
break;
|
|
123
124
|
}
|
|
124
125
|
case 'NONE': {
|
|
125
|
-
firebasePersistence = firebase.auth.Auth.Persistence.NONE;
|
|
126
|
+
firebasePersistence = this.firebase.auth.Auth.Persistence.NONE;
|
|
126
127
|
break;
|
|
127
128
|
}
|
|
128
129
|
default: {
|
|
129
|
-
firebasePersistence = firebase.auth.Auth.Persistence.NONE;
|
|
130
|
+
firebasePersistence = this.firebase.auth.Auth.Persistence.NONE;
|
|
130
131
|
break;
|
|
131
132
|
}
|
|
132
133
|
}
|
|
133
|
-
return firebase.auth().setPersistence(firebasePersistence).then(async () => {
|
|
134
|
-
return firebase.auth().signInWithCustomToken(token).then(async () => {
|
|
134
|
+
return this.firebase.auth().setPersistence(firebasePersistence).then(async () => {
|
|
135
|
+
return this.firebase.auth().signInWithCustomToken(token).then(async () => {
|
|
135
136
|
// that.firebaseSignInWithCustomToken.next(response);
|
|
136
137
|
}).catch((error) => {
|
|
137
138
|
that.logger.error('[FIREBASEAuthSERVICE] signInFirebaseWithCustomToken Error: ', error);
|
|
@@ -151,7 +152,7 @@ export class FirebaseAuthService extends MessagingAuthService {
|
|
|
151
152
|
*/
|
|
152
153
|
createUserWithEmailAndPassword(email: string, password: string): any {
|
|
153
154
|
const that = this;
|
|
154
|
-
return firebase.auth().createUserWithEmailAndPassword(email, password).then((response) => {
|
|
155
|
+
return this.firebase.auth().createUserWithEmailAndPassword(email, password).then((response) => {
|
|
155
156
|
that.logger.debug('[FIREBASEAuthSERVICE] CRATE USER WITH EMAIL: ', email, ' & PSW: ', password);
|
|
156
157
|
// that.firebaseCreateUserWithEmailAndPassword.next(response);
|
|
157
158
|
return response;
|
|
@@ -167,7 +168,7 @@ export class FirebaseAuthService extends MessagingAuthService {
|
|
|
167
168
|
*/
|
|
168
169
|
sendPasswordResetEmail(email: string): any {
|
|
169
170
|
const that = this;
|
|
170
|
-
return firebase.auth().sendPasswordResetEmail(email).then(() => {
|
|
171
|
+
return this.firebase.auth().sendPasswordResetEmail(email).then(() => {
|
|
171
172
|
that.logger.debug('[FIREBASEAuthSERVICE] firebase-send-password-reset-email');
|
|
172
173
|
// that.firebaseSendPasswordResetEmail.next(email);
|
|
173
174
|
}).catch((error) => {
|
|
@@ -180,7 +181,7 @@ export class FirebaseAuthService extends MessagingAuthService {
|
|
|
180
181
|
*/
|
|
181
182
|
private signOut(): Promise<boolean> {
|
|
182
183
|
const that = this;
|
|
183
|
-
return new Promise((resolve, reject)=> {firebase.auth().signOut().then(() => {
|
|
184
|
+
return new Promise((resolve, reject)=> {this.firebase.auth().signOut().then(() => {
|
|
184
185
|
that.logger.debug('[FIREBASEAuthSERVICE] firebase-sign-out');
|
|
185
186
|
// cancello token
|
|
186
187
|
// this.appStorage.removeItem('tiledeskToken');
|
|
@@ -200,7 +201,7 @@ export class FirebaseAuthService extends MessagingAuthService {
|
|
|
200
201
|
*/
|
|
201
202
|
delete() {
|
|
202
203
|
const that = this;
|
|
203
|
-
firebase.auth().currentUser.delete().then(() => {
|
|
204
|
+
this.firebase.auth().currentUser.delete().then(() => {
|
|
204
205
|
that.logger.debug('[FIREBASEAuthSERVICE] firebase-current-user-delete');
|
|
205
206
|
// that.firebaseCurrentUserDelete.next();
|
|
206
207
|
}).catch((error) => {
|