Files
doneit-web/.angular/cache/14.2.12/babel-webpack/8b62aa98bef402de2ba6c6af2a4dc9f9.json
T

1 line
24 KiB
JSON
Raw Normal View History

2023-06-30 09:54:21 +01:00
{"ast":null,"code":"import _asyncToGenerator from \"C:/Users/eudes.inacio/GabineteDigital/gabinete-digital-fo/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";\nimport { __decorate } from \"tslib\";\nimport __NG_CLI_RESOURCE__0 from \"./new-group.page.html?ngResource\";\nimport __NG_CLI_RESOURCE__1 from \"./new-group.page.scss?ngResource\";\nimport { Component } from '@angular/core';\nimport { ModalController, NavParams, PickerController, PopoverController } from '@ionic/angular';\nimport { GroupDurationPage } from 'src/app/shared/popover/group-duration/group-duration.page';\nimport { GroupContactsPage } from '../group-messages/group-contacts/group-contacts.page';\nimport { ThemeService } from 'src/app/services/theme.service';\nimport { ChatSystemService } from 'src/app/services/chat/chat-system.service';\nimport { SessionStore } from 'src/app/store/session.service';\nlet NewGroupPage = class NewGroupPage {\n constructor(pickerController, popoverController, modalController, navParams, ThemeService, ChatSystemService) {\n this.pickerController = pickerController;\n this.popoverController = popoverController;\n this.modalController = modalController;\n this.navParams = navParams;\n this.ThemeService = ThemeService;\n this.ChatSystemService = ChatSystemService;\n this.selectedDuration = ['', '', ''];\n this.loggedUserChat = SessionStore.user.ChatData['data'];\n this.isGroupCreated = false;\n this.groupName = this.navParams.get('name');\n this.documents = this.navParams.get('documents');\n }\n ngOnInit() {\n // this.chatService.refreshtoken();\n // console.log(this.documents)\n }\n _ionChange(event) {\n this.showDuration = event.detail.checked;\n if (event.detail.checked) {\n this.thedate = new Date();\n } else {\n this.thedate = '';\n }\n }\n close() {\n this.modalController.dismiss();\n }\n createGroup() {\n var _this = this;\n return _asyncToGenerator(function* () {\n let name = _this.groupName.split(' ').join('-');\n //Take out all special characters in string\n name = name.normalize(\"NFD\").replace(/[\\u0300-\\u036f]/g, \"\");\n let customFields = {};\n let res;\n if (_this.thedate) {\n let customFields = {\n \"countDownDate\": _this.thedate\n };\n res = yield _this.ChatSystemService.createPrivateRoom(name, SessionStore.user.UserName, customFields);\n } else {\n res = yield _this.ChatSystemService.createPrivateRoom(name, SessionStore.user.UserName, customFields);\n }\n _this.isGroupCreated = true;\n _this.addContacts(res.result);\n _this.ChatSystemService.getAllRooms();\n setTimeout(() => {\n _this.ChatSystemService.subscribeToRoomUpdate(res.result.rid, res.result);\n }, 10);\n })();\n }\n addContacts(room) {\n var _this2 = this;\n return _asyncToGenerator(function* () {\n _this2.close();\n let name = _this2.groupName.split(' ').join('-');\n const modal = yield _this2.modalController.create({\n component: GroupContactsPage,\n componentProps: {\n room: room\n },\n cssClass: 'contacts',\n backdropDismiss: false\n });\n yield modal.present();\n modal.onDidDismiss();\n })();\n }\n setDuration(ev) {\n var _this3 = this;\n return _asyncToGenerator(function* () {\n const popover = yield _this3.popoverController.create({\n component: GroupDurationPage,\n cssClass: 'group-duration',\n event: ev,\n translucent: true\n });\n return yield popover.present();\n })();\n }\n showPicker() {\n var _this4 = this;\n return _asyncToGenerator(function* () {\n const picker = yield _this4.pickerController.create({\n cssClass: '',\n buttons: [{\n text: 'Cancelar',\n role: 'cancel',\n cssClass: 'btn-cancel'\n }, {\n text: 'Ok',\n cssClass: 'btn-cancel',\n handler: value => {\n let now = new Date();\n