mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
remove un used import
This commit is contained in:
@@ -20,6 +20,7 @@ import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { NetworkServiceService} from 'src/app/services/network-service.service';
|
||||
import { ViewedMessageService } from './viewed-message.service'
|
||||
import { NotificationsService } from '../notifications.service';
|
||||
import { Subscribe } from '../subcribe';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
@@ -41,6 +42,9 @@ export class ChatSystemService {
|
||||
sessionStore = SessionStore
|
||||
delete = []
|
||||
loadingUsers = false
|
||||
|
||||
onRoomsLoad = new Subscribe({execute : false, deleteOnExecute: true})
|
||||
|
||||
|
||||
constructor(
|
||||
private RochetChatConnectorService: RochetChatConnectorService,
|
||||
@@ -299,7 +303,6 @@ export class ChatSystemService {
|
||||
|
||||
this.loadingWholeList = false
|
||||
await this.storage.set('Rooms', rooms);
|
||||
console.log('this._group', this._group)
|
||||
|
||||
this.sortRoomList()
|
||||
|
||||
@@ -311,6 +314,7 @@ export class ChatSystemService {
|
||||
this.sortRoomList()
|
||||
}, 10000)
|
||||
|
||||
this.onRoomsLoad.executor()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -687,4 +691,46 @@ export class ChatSystemService {
|
||||
return this.RochetChatConnectorService.getUserOfRoom(roomId);
|
||||
}
|
||||
|
||||
|
||||
async createGroup(name) {
|
||||
const res: any = await this.createPrivateRoom(name, SessionStore.user.UserName, {});
|
||||
console.log('room is created', res)
|
||||
if(res?.result?.rid) {
|
||||
try {
|
||||
await this.getAllRooms();
|
||||
} catch (e) {}
|
||||
console.log('room is loaded')
|
||||
return res
|
||||
} else {
|
||||
return res
|
||||
}
|
||||
}
|
||||
|
||||
getGroupByName(name ) {
|
||||
return this._group.find( e=> e.name == name)
|
||||
}
|
||||
|
||||
async waitRoomToCreate(rid): Promise<RoomService> {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
let sub;
|
||||
|
||||
sub = this.onRoomsLoad.subscribe(() => {
|
||||
const room = this.getRoomById(rid)
|
||||
if (room) {
|
||||
resolve(room)
|
||||
sub.unSubscribe()
|
||||
}
|
||||
})
|
||||
|
||||
try {
|
||||
await this.getAllRooms();
|
||||
} catch (e) {}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
searchContact(name, username) {
|
||||
return this.users.find( e=> e.name == name || e.username == username)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user