@chat21/chat21-ionic 3.0.55-RC6 → 3.0.57
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/CHANGELOG.md +95 -1
- package/package.json +1 -1
- package/src/app/app.component.scss +1 -0
- package/src/app/app.component.ts +615 -515
- package/src/app/app.module.ts +1 -1
- package/src/app/chatlib/conversation-detail/conversation-content/conversation-content.component.ts +2 -1
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.html +44 -24
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.scss +7 -8
- package/src/app/chatlib/conversation-detail/ion-conversation-detail/ion-conversation-detail.component.ts +9 -7
- package/src/app/chatlib/conversation-detail/message/avatar/avatar.component.ts +1 -1
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.html +22 -14
- package/src/app/chatlib/conversation-detail/message/bubble-message/bubble-message.component.ts +85 -45
- package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.scss +1 -1
- package/src/app/chatlib/conversation-detail/message/buttons/action-button/action-button.component.ts +1 -1
- package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.scss +4 -4
- package/src/app/chatlib/conversation-detail/message/buttons/link-button/link-button.component.ts +1 -1
- package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.scss +1 -1
- package/src/app/chatlib/conversation-detail/message/buttons/text-button/text-button.component.ts +1 -1
- package/src/app/chatlib/conversation-detail/message/frame/frame.component.ts +4 -2
- package/src/app/chatlib/conversation-detail/message/image/image.component.html +9 -8
- package/src/app/chatlib/conversation-detail/message/image/image.component.scss +3 -2
- package/src/app/chatlib/conversation-detail/message/image/image.component.ts +35 -3
- package/src/app/chatlib/conversation-detail/message/info-message/info-message.component.ts +1 -1
- package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.html +56 -0
- package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.scss +169 -0
- package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.spec.ts +33 -0
- package/src/app/chatlib/conversation-detail/message/message-attachment/message-attachment.component.ts +80 -0
- package/src/app/chatlib/conversation-detail/message/return-receipt/return-receipt.component.ts +1 -1
- package/src/app/chatlib/conversation-detail/message/text/text.component.html +2 -1
- package/src/app/chatlib/conversation-detail/message/text/text.component.ts +4 -4
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.html +40 -13
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.scss +147 -1
- package/src/app/chatlib/list-conversations-component/ion-list-conversations/ion-list-conversations.component.ts +47 -2
- package/src/app/components/authentication/login/login.component.scss +1 -1
- package/src/app/components/contacts-directory/contacts-directory.component.html +3 -2
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.html +2 -2
- package/src/app/components/conversation-detail/header-conversation-detail/header-conversation-detail.component.ts +28 -13
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.html +1 -2
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.scss +10 -6
- package/src/app/components/conversation-detail/message-text-area/message-text-area.component.ts +46 -43
- package/src/app/components/conversation-info/advanced-info-accordion/advanced-info-accordion.component.html +2 -2
- package/src/app/components/conversation-info/info-content/info-content.component.ts +15 -5
- package/src/app/components/conversation-info/info-group/info-group.component.ts +4 -4
- package/src/app/components/utils/avatar-profile/avatar-profile.component.html +2 -1
- package/src/app/components/utils/user-presence/user-presence.component.ts +8 -6
- package/src/app/pages/contacts-directory/contacts-directory.page.ts +1 -1
- package/src/app/pages/conversation-detail/conversation-detail.page.html +4 -1
- package/src/app/pages/conversation-detail/conversation-detail.page.ts +218 -42
- package/src/app/pages/conversations-list/conversations-list.page.html +1 -1
- package/src/app/pages/conversations-list/conversations-list.page.ts +135 -45
- package/src/app/pages/loader-preview/loader-preview.page.html +1 -1
- package/src/app/pages/loader-preview/loader-preview.page.ts +18 -5
- package/src/app/pages/profile-info/profile-info.page.html +2 -0
- package/src/app/services/nav-proxy.service.ts +2 -2
- package/src/app/services/network-service/network.service.spec.ts +12 -0
- package/src/app/services/network-service/network.service.ts +46 -0
- package/src/app/shared/shared.module.ts +2 -0
- package/src/assets/i18n/en.json +4 -2
- package/src/assets/i18n/it.json +5 -3
- package/src/chat21-core/providers/abstract/app-storage.service.ts +2 -2
- package/src/chat21-core/providers/chat-manager.ts +2 -1
- package/src/chat21-core/providers/firebase/firebase-archivedconversations-handler.ts +3 -2
- package/src/chat21-core/providers/firebase/firebase-auth-service.ts +112 -69
- package/src/chat21-core/providers/firebase/firebase-conversations-handler.ts +4 -4
- package/src/chat21-core/providers/firebase/firebase-image-repo.ts +1 -1
- package/src/chat21-core/providers/firebase/firebase-notifications.ts +29 -29
- package/src/chat21-core/providers/firebase/firebase-presence.service.ts +1 -0
- package/src/chat21-core/providers/localSessionStorage.ts +155 -154
- package/src/chat21-core/providers/tiledesk/tiledesk-auth.service.ts +42 -12
- package/src/chat21-core/utils/user-typing/user-typing.component.html +6 -11
- package/src/chat21-core/utils/utils.ts +3 -3
- package/src/global.scss +17 -0
- package/src/index.html +27 -59
|
@@ -6,35 +6,35 @@ import { LoggerService } from './abstract/logger.service';
|
|
|
6
6
|
import { LoggerInstance } from './logger/loggerInstance';
|
|
7
7
|
|
|
8
8
|
@Injectable()
|
|
9
|
-
export class LocalSessionStorage extends AppStorageService{
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
9
|
+
export class LocalSessionStorage extends AppStorageService {
|
|
10
|
+
|
|
11
|
+
private storagePrefix: string = STORAGE_PREFIX;
|
|
12
|
+
private projectID: string;
|
|
13
|
+
private persistence: string;
|
|
14
|
+
private logger: LoggerService = LoggerInstance.getInstance();
|
|
15
|
+
|
|
16
|
+
initialize(storagePrefix: string, persistence: string, projectID: string): void {
|
|
17
|
+
this.storagePrefix = storagePrefix;
|
|
18
|
+
this.projectID = projectID;
|
|
19
|
+
this.persistence = persistence;
|
|
20
|
+
// this.persistence = 'LOCAL';
|
|
21
|
+
// this.logger.info('[LocalSessionStorage] - initialize ', this.storagePrefix, this.persistence, this.projectID)
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
/** GET item in local/session storage from key value
|
|
25
25
|
* @param key
|
|
26
26
|
*/
|
|
27
27
|
getItem(key: string) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
28
|
+
let prefix;
|
|
29
|
+
try {
|
|
30
|
+
// const sv = 'sv' + environment.shemaVersion + '_';
|
|
31
|
+
// prefix = prefix + sv;
|
|
32
|
+
prefix = this.storagePrefix + '_';
|
|
33
|
+
} catch (e) {
|
|
34
|
+
this.logger.error('[LocalSessionStorage] getItem - Error :' + e);
|
|
35
|
+
}
|
|
36
|
+
const newKey = prefix + this.projectID + '_' + key;
|
|
37
|
+
return this.getValueForKey(newKey);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
/** SET new item in local/session storage
|
|
@@ -42,173 +42,174 @@ export class LocalSessionStorage extends AppStorageService{
|
|
|
42
42
|
* @param value
|
|
43
43
|
*/
|
|
44
44
|
setItem(key: string, value: any): void {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
45
|
+
// this.removeItem(key);
|
|
46
|
+
let prefix;
|
|
47
|
+
try {
|
|
48
|
+
// const sv = 'sv' + environment.shemaVersion + '_';
|
|
49
|
+
// prefix = prefix + sv;
|
|
50
|
+
prefix = this.storagePrefix + '_';
|
|
51
|
+
} catch (e) {
|
|
52
|
+
this.logger.error('[LocalSessionStorage] setItem > Error :' + e);
|
|
53
|
+
}
|
|
54
|
+
const newKey = prefix + this.projectID + '_' + key;
|
|
55
|
+
this.saveValueForKey(newKey, value);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
/** GET item in local/session storage from key value without project id SUFFIX
|
|
59
|
-
*
|
|
59
|
+
* @param key
|
|
60
|
+
* @deprecated
|
|
60
61
|
*/
|
|
61
|
-
getItemWithoutProjectID(key: string) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
62
|
+
// getItemWithoutProjectID(key: string) {
|
|
63
|
+
// let prefix;
|
|
64
|
+
// try {
|
|
65
|
+
// // const sv = 'sv' + environment.shemaVersion + '_';
|
|
66
|
+
// // prefix = prefix + sv;
|
|
67
|
+
// prefix = this.storagePrefix + '_';
|
|
68
|
+
// } catch (e) {
|
|
69
|
+
// this.logger.error('[LocalSessionStorage] getItemWithoutProjectID > Error :' + e);
|
|
70
|
+
// }
|
|
71
|
+
// const newKey = prefix + key;
|
|
72
|
+
// return this.getValueForKey(newKey);
|
|
73
|
+
// }
|
|
73
74
|
|
|
74
75
|
/** SET new item in local/session storage without project id SUFFIX
|
|
75
76
|
* @param key
|
|
76
77
|
* @param value
|
|
77
78
|
*/
|
|
78
|
-
setItemWithoutProjectID(key: string, value: any): void {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
79
|
+
// setItemWithoutProjectID(key: string, value: any): void {
|
|
80
|
+
// this.removeItem(key);
|
|
81
|
+
// let prefix = STORAGE_PREFIX;
|
|
82
|
+
// try {
|
|
83
|
+
// // const sv = 'sv' + environment.shemaVersion + '_';
|
|
84
|
+
// // prefix = prefix + sv;
|
|
85
|
+
// prefix = this.storagePrefix + '_';
|
|
86
|
+
// } catch (e) {
|
|
87
|
+
// this.logger.error('[LocalSessionStorage] setItemWithoutProjectID > Error :' + e);
|
|
88
|
+
// }
|
|
89
|
+
// const newKey = prefix + key;
|
|
90
|
+
// this.saveValueForKey(newKey, value);
|
|
91
|
+
// }
|
|
91
92
|
|
|
92
93
|
removeItem(key: string): void {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
94
|
+
let prefix;
|
|
95
|
+
try {
|
|
96
|
+
// const sv = 'sv' + environment.shemaVersion + '_';
|
|
97
|
+
// prefix = prefix + sv;
|
|
98
|
+
prefix = this.storagePrefix + '_';
|
|
99
|
+
} catch (e) {
|
|
100
|
+
this.logger.error('[LocalSessionStorage] removeItem > Error :' + e);
|
|
101
|
+
}
|
|
102
|
+
const newKey = prefix + this.projectID + '_' + key;
|
|
103
|
+
return this.removeItemForKey(newKey);
|
|
103
104
|
}
|
|
104
105
|
|
|
105
106
|
clear(): void {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
for (let i = 0; i < arrayKey.length; i++) {
|
|
124
|
-
// localStorage.removeItem(arrayKey[i]);
|
|
125
|
-
this.removeItemForKey(arrayKey[i]);
|
|
107
|
+
let prefix;
|
|
108
|
+
try {
|
|
109
|
+
// const sv = 'sv' + environment.shemaVersion + '_';
|
|
110
|
+
// prefix = prefix + sv;
|
|
111
|
+
prefix = this.storagePrefix + '_';
|
|
112
|
+
} catch (e) {
|
|
113
|
+
this.logger.error('[LocalSessionStorage] clear > Error :' + e);
|
|
114
|
+
}
|
|
115
|
+
const prefixKey = prefix + this.projectID
|
|
116
|
+
const arrayKey: Array<string> = [];
|
|
117
|
+
for (let i = 0; i < localStorage.length; i++) {
|
|
118
|
+
const key = localStorage.key(i);
|
|
119
|
+
if (key.indexOf(prefixKey) !== -1) {
|
|
120
|
+
arrayKey.push(key);
|
|
126
121
|
}
|
|
127
|
-
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
for (let i = 0; i < arrayKey.length; i++) {
|
|
125
|
+
// localStorage.removeItem(arrayKey[i]);
|
|
126
|
+
this.removeItemForKey(arrayKey[i]);
|
|
127
|
+
}
|
|
128
|
+
|
|
128
129
|
}
|
|
129
130
|
|
|
130
131
|
|
|
131
132
|
// ---------- PRIVATE METHODS start --------------- //
|
|
132
133
|
|
|
133
134
|
private getValueForKey(key) {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
return null;
|
|
147
|
-
}
|
|
148
|
-
} else if (this.persistence === 'none' || this.persistence === 'NONE') {
|
|
135
|
+
if (this.persistence === 'local' || this.persistence === 'LOCAL') {
|
|
136
|
+
if (supports_html5_storage()) {
|
|
137
|
+
return localStorage.getItem(key);
|
|
138
|
+
} else {
|
|
139
|
+
this.logger.warn('localStorage is not defind. Storage disabled');
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
} else if (this.persistence === 'session' || this.persistence === 'SESSION') {
|
|
143
|
+
if (supports_html5_session()) {
|
|
144
|
+
return sessionStorage.getItem(key);
|
|
145
|
+
} else {
|
|
146
|
+
this.logger.warn('sessionStorage is not defind. Storage disabled');
|
|
149
147
|
return null;
|
|
148
|
+
}
|
|
149
|
+
} else if (this.persistence === 'none' || this.persistence === 'NONE') {
|
|
150
|
+
return null;
|
|
151
|
+
} else {
|
|
152
|
+
if (supports_html5_storage()) {
|
|
153
|
+
return localStorage.getItem(key);
|
|
150
154
|
} else {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
} else {
|
|
154
|
-
this.logger.warn('localStorage is not defind. Storage disabled');
|
|
155
|
-
return null;
|
|
156
|
-
}
|
|
155
|
+
this.logger.warn('localStorage is not defind. Storage disabled');
|
|
156
|
+
return null;
|
|
157
157
|
}
|
|
158
|
+
}
|
|
158
159
|
}
|
|
159
160
|
|
|
160
161
|
private saveValueForKey(key, value) {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
return null;
|
|
174
|
-
}
|
|
175
|
-
} else if (this.persistence === 'none' || this.persistence === 'NONE') {
|
|
162
|
+
if (this.persistence === 'local' || this.persistence === 'LOCAL') {
|
|
163
|
+
if (supports_html5_storage()) {
|
|
164
|
+
return localStorage.setItem(key, value);
|
|
165
|
+
} else {
|
|
166
|
+
this.logger.warn('localStorage is not defined. Storage disabled');
|
|
167
|
+
return null;
|
|
168
|
+
}
|
|
169
|
+
} else if (this.persistence === 'session' || this.persistence === 'SESSION') {
|
|
170
|
+
if (supports_html5_session()) {
|
|
171
|
+
return sessionStorage.setItem(key, value);
|
|
172
|
+
} else {
|
|
173
|
+
this.logger.warn('sessionStorage is not defined. Storage disabled');
|
|
176
174
|
return null;
|
|
175
|
+
}
|
|
176
|
+
} else if (this.persistence === 'none' || this.persistence === 'NONE') {
|
|
177
|
+
return null;
|
|
178
|
+
} else {
|
|
179
|
+
if (supports_html5_storage()) {
|
|
180
|
+
return localStorage.setItem(key, value);
|
|
177
181
|
} else {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
} else {
|
|
181
|
-
this.logger.warn('localStorage is not defind. Storage disabled');
|
|
182
|
-
return null;
|
|
183
|
-
}
|
|
182
|
+
this.logger.warn('localStorage is not defined. Storage disabled');
|
|
183
|
+
return null;
|
|
184
184
|
}
|
|
185
|
+
}
|
|
185
186
|
}
|
|
186
187
|
|
|
187
188
|
private removeItemForKey(key: string) {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
return null;
|
|
201
|
-
}
|
|
202
|
-
} else if (this.persistence === 'none' || this.persistence === 'NONE') {
|
|
189
|
+
if (this.persistence === 'local' || this.persistence === 'LOCAL') {
|
|
190
|
+
if (supports_html5_storage()) {
|
|
191
|
+
return localStorage.removeItem(key);
|
|
192
|
+
} else {
|
|
193
|
+
this.logger.warn('localStorage is not defind. Storage disabled');
|
|
194
|
+
return null;
|
|
195
|
+
}
|
|
196
|
+
} else if (this.persistence === 'session' || this.persistence === 'SESSION') {
|
|
197
|
+
if (supports_html5_session()) {
|
|
198
|
+
return sessionStorage.removeItem(key);
|
|
199
|
+
} else {
|
|
200
|
+
this.logger.warn('sessionStorage is not defind. Storage disabled');
|
|
203
201
|
return null;
|
|
202
|
+
}
|
|
203
|
+
} else if (this.persistence === 'none' || this.persistence === 'NONE') {
|
|
204
|
+
return null;
|
|
205
|
+
} else {
|
|
206
|
+
if (supports_html5_storage()) {
|
|
207
|
+
return localStorage.removeItem(key);
|
|
204
208
|
} else {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
} else {
|
|
208
|
-
this.logger.warn('localStorage is not defind. Storage disabled');
|
|
209
|
-
return null;
|
|
210
|
-
}
|
|
209
|
+
this.logger.warn('localStorage is not defind. Storage disabled');
|
|
210
|
+
return null;
|
|
211
211
|
}
|
|
212
|
+
}
|
|
212
213
|
}
|
|
213
214
|
|
|
214
215
|
}
|
|
@@ -5,12 +5,16 @@ import { UserModel } from 'src/chat21-core/models/user';
|
|
|
5
5
|
import { avatarPlaceholder, getColorBck } from 'src/chat21-core/utils/utils-user';
|
|
6
6
|
import { AppStorageService } from '../abstract/app-storage.service';
|
|
7
7
|
import { LoggerInstance } from '../logger/loggerInstance';
|
|
8
|
+
// import { BehaviorSubject } from 'rxjs';
|
|
9
|
+
// import { EventsService } from 'src/app/services/events-service';
|
|
10
|
+
|
|
8
11
|
|
|
9
12
|
@Injectable({
|
|
10
13
|
providedIn: 'root'
|
|
11
14
|
})
|
|
12
15
|
export class TiledeskAuthService {
|
|
13
16
|
|
|
17
|
+
// public isOnline$: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(null);
|
|
14
18
|
// private persistence: string;
|
|
15
19
|
public SERVER_BASE_URL: string;
|
|
16
20
|
|
|
@@ -22,9 +26,12 @@ export class TiledeskAuthService {
|
|
|
22
26
|
private tiledeskToken: string;
|
|
23
27
|
private currentUser: UserModel;
|
|
24
28
|
private logger: LoggerService = LoggerInstance.getInstance()
|
|
25
|
-
|
|
26
|
-
constructor(
|
|
27
|
-
|
|
29
|
+
|
|
30
|
+
constructor(
|
|
31
|
+
public http: HttpClient,
|
|
32
|
+
public appStorage: AppStorageService,
|
|
33
|
+
// private events: EventsService,
|
|
34
|
+
) { }
|
|
28
35
|
|
|
29
36
|
|
|
30
37
|
initialize(serverBaseUrl: string) {
|
|
@@ -57,7 +64,8 @@ export class TiledeskAuthService {
|
|
|
57
64
|
if (data['success'] && data['token']) {
|
|
58
65
|
that.tiledeskToken = data['token'];
|
|
59
66
|
that.createCompleteUser(data['user']);
|
|
60
|
-
that.appStorage.setItem('tiledeskToken', that.tiledeskToken);
|
|
67
|
+
// that.appStorage.setItem('tiledeskToken', that.tiledeskToken);
|
|
68
|
+
this.checkAndSetInStorageTiledeskToken(that.tiledeskToken)
|
|
61
69
|
resolve(that.tiledeskToken)
|
|
62
70
|
}
|
|
63
71
|
}, (error) => {
|
|
@@ -86,7 +94,8 @@ export class TiledeskAuthService {
|
|
|
86
94
|
if (data['success'] && data['token']) {
|
|
87
95
|
that.tiledeskToken = data['token'];
|
|
88
96
|
that.createCompleteUser(data['user']);
|
|
89
|
-
that.appStorage.setItem('tiledeskToken', that.tiledeskToken);
|
|
97
|
+
// that.appStorage.setItem('tiledeskToken', that.tiledeskToken);
|
|
98
|
+
this.checkAndSetInStorageTiledeskToken(that.tiledeskToken)
|
|
90
99
|
resolve(that.tiledeskToken)
|
|
91
100
|
}
|
|
92
101
|
}, (error) => {
|
|
@@ -111,7 +120,9 @@ export class TiledeskAuthService {
|
|
|
111
120
|
if (data['success'] && data['token']) {
|
|
112
121
|
that.tiledeskToken = data['token'];
|
|
113
122
|
that.createCompleteUser(data['user']);
|
|
114
|
-
|
|
123
|
+
|
|
124
|
+
// that.appStorage.setItem('tiledeskToken', that.tiledeskToken); // salvarlo esternamente nell'app.component
|
|
125
|
+
this.checkAndSetInStorageTiledeskToken(that.tiledeskToken)
|
|
115
126
|
resolve(this.currentUser)
|
|
116
127
|
}
|
|
117
128
|
}, (error) => {
|
|
@@ -120,10 +131,13 @@ export class TiledeskAuthService {
|
|
|
120
131
|
});
|
|
121
132
|
}
|
|
122
133
|
|
|
123
|
-
logOut(){
|
|
124
|
-
this.logger.
|
|
134
|
+
logOut() {
|
|
135
|
+
this.logger.log('[TILEDESK-AUTH] - LOGOUT')
|
|
125
136
|
this.appStorage.removeItem('tiledeskToken')
|
|
126
137
|
this.appStorage.removeItem('currentUser')
|
|
138
|
+
this.setCurrentUser(null);
|
|
139
|
+
// this.isOnline$.next(false)
|
|
140
|
+
|
|
127
141
|
}
|
|
128
142
|
|
|
129
143
|
|
|
@@ -149,13 +163,29 @@ export class TiledeskAuthService {
|
|
|
149
163
|
member.fullname = fullname;
|
|
150
164
|
member.avatar = avatar;
|
|
151
165
|
member.color = color;
|
|
152
|
-
this.currentUser = member;
|
|
153
|
-
this.logger.
|
|
166
|
+
this.currentUser = member;
|
|
167
|
+
this.logger.log('[TILEDESK-AUTH] - createCompleteUser member ', member);
|
|
154
168
|
this.appStorage.setItem('currentUser', JSON.stringify(this.currentUser));
|
|
169
|
+
// this.isOnline$.next(true)
|
|
155
170
|
} catch (err) {
|
|
156
|
-
this.logger.error('[TILEDESK-AUTH]- createCompleteUser ERR ', err)
|
|
171
|
+
this.logger.error('[TILEDESK-AUTH]- createCompleteUser ERR ', err)
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
private checkAndSetInStorageTiledeskToken(tiledeskToken) {
|
|
177
|
+
this.logger.log('[TILEDESK-AUTH] - checkAndSetInStorageTiledeskToken tiledeskToken from request', tiledeskToken)
|
|
178
|
+
const storedTiledeskToken = this.appStorage.getItem('tiledeskToken');
|
|
179
|
+
this.logger.log('[TILEDESK-AUTH] - checkAndSetInStorageTiledeskToken storedTiledeskToken ', storedTiledeskToken)
|
|
180
|
+
if (!storedTiledeskToken) {
|
|
181
|
+
this.logger.log('[TILEDESK-AUTH] - checkAndSetInStorageTiledeskToken TOKEN DOES NOT EXIST - RUN SET ')
|
|
182
|
+
this.appStorage.setItem('tiledeskToken', tiledeskToken);
|
|
183
|
+
} else if (storedTiledeskToken && storedTiledeskToken !== tiledeskToken) {
|
|
184
|
+
this.logger.log('[TILEDESK-AUTH] - checkAndSetInStorageTiledeskToken STORED-TOKEN EXIST BUT IS != FROM TOKEN - RUN SET ')
|
|
185
|
+
this.appStorage.setItem('tiledeskToken', tiledeskToken);
|
|
186
|
+
} else if (storedTiledeskToken && storedTiledeskToken === tiledeskToken){
|
|
187
|
+
this.logger.log('[TILEDESK-AUTH] - checkAndSetInStorageTiledeskToken STORED-TOKEN EXIST AND IS = TO TOKEN ')
|
|
157
188
|
}
|
|
158
|
-
|
|
159
189
|
}
|
|
160
190
|
|
|
161
191
|
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<div class="bounce3"></div>
|
|
8
|
-
<span></span>
|
|
9
|
-
</span> -->
|
|
10
|
-
<div class="tile-typing-now" [class.active]="isTyping"><span *ngIf="nameUserTypingNow">{{nameUserTypingNow}} </span>{{ translationMap.get('LABEL_IS_WRITING') }}</div>
|
|
11
|
-
<!-- </div> -->
|
|
1
|
+
<div class="tile-typing-now" [class.active]="isTyping">
|
|
2
|
+
<span *ngIf="nameUserTypingNow">
|
|
3
|
+
{{nameUserTypingNow}}
|
|
4
|
+
</span>
|
|
5
|
+
{{ translationMap?.get('LABEL_IS_WRITING') }}
|
|
6
|
+
</div>
|
|
@@ -700,7 +700,7 @@ export function getParameterByName(name: string) {
|
|
|
700
700
|
|
|
701
701
|
|
|
702
702
|
export async function presentModal(modalController, page, attributes) {
|
|
703
|
-
console.log('UTILS - presentModal');
|
|
703
|
+
// console.log('UTILS - presentModal');
|
|
704
704
|
const modal: HTMLIonModalElement =
|
|
705
705
|
await modalController.create({
|
|
706
706
|
component: page,
|
|
@@ -711,7 +711,7 @@ export async function presentModal(modalController, page, attributes) {
|
|
|
711
711
|
await modal.present();
|
|
712
712
|
modal.onDidDismiss().then((detail: any) => {
|
|
713
713
|
if (detail !== null) {
|
|
714
|
-
console.log('UTILS - presentModal - detail.data:', detail.data);
|
|
714
|
+
// console.log('UTILS - presentModal - detail.data:', detail.data);
|
|
715
715
|
return 'CLOSE!!!!!';
|
|
716
716
|
}
|
|
717
717
|
});
|
|
@@ -719,7 +719,7 @@ export async function presentModal(modalController, page, attributes) {
|
|
|
719
719
|
|
|
720
720
|
|
|
721
721
|
export async function closeModal(modalController: ModalController) {
|
|
722
|
-
console.log('UTILS - closeModal', modalController);
|
|
722
|
+
// console.log('UTILS - closeModal', modalController);
|
|
723
723
|
await modalController.getTop();
|
|
724
724
|
await modalController.dismiss({ confirmed: true });
|
|
725
725
|
// try {
|
package/src/global.scss
CHANGED
|
@@ -571,3 +571,20 @@ select:-webkit-autofill:focus {
|
|
|
571
571
|
line-height: 42px;
|
|
572
572
|
}
|
|
573
573
|
/* End rules for the member list refactoring in the "info-group.component.html" (replacement of ion-grid with ion-list) */
|
|
574
|
+
.missing-connection-toast {
|
|
575
|
+
--background:#FDD764;
|
|
576
|
+
--color:#2e3939;
|
|
577
|
+
font-weight: 500;
|
|
578
|
+
font-size: 16px;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
.missing-connection-toast::part(message) {
|
|
583
|
+
// display: none;
|
|
584
|
+
display: flex;
|
|
585
|
+
align-items: center;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
|
|
589
|
+
|
|
590
|
+
|