Commit 451e611b authored by Marcelo Rivera's avatar Marcelo Rivera

(feat): open wire modal after logging in if the modal was opened

1 merge request!528WIP: (feat): Minds Pro
Pipeline #80475836 failed with stages
in 8 minutes and 7 seconds
......@@ -66,7 +66,7 @@ export class ProChannelComponent implements OnInit, AfterViewInit, OnDestroy {
protected cd: ChangeDetectorRef,
protected modal: SignupModalService,
protected modalService: OverlayModalService,
protected injector: Injector
protected injector: Injector,
) {}
ngOnInit() {
......@@ -90,6 +90,10 @@ export class ProChannelComponent implements OnInit, AfterViewInit, OnDestroy {
this.modalService
.setContainer(this.overlayModal)
.setRoot(this.element.nativeElement);
if (sessionStorage.getItem('pro::wire-modal::open')) {
this.wire();
}
}
listen() {
......@@ -127,8 +131,8 @@ export class ProChannelComponent implements OnInit, AfterViewInit, OnDestroy {
const title = [
(this.channel.pro_settings.title as string) ||
this.channel.name ||
this.channel.username,
this.channel.name ||
this.channel.username,
];
switch (this.type) {
......
......@@ -41,7 +41,7 @@ export class ProChannelService {
protected entitiesService: EntitiesService,
protected session: Session,
protected route: ActivatedRoute,
protected modalService: OverlayModalService
protected modalService: OverlayModalService,
) {}
async load(id: string) {
......@@ -101,9 +101,9 @@ export class ProChannelService {
}
async getContent({
limit,
offset,
}: { limit?: number; offset? } = {}): Promise<{
limit,
offset,
}: { limit?: number; offset? } = {}): Promise<{
content: Array<any>;
offset: any;
}> {
......@@ -276,9 +276,15 @@ export class ProChannelService {
}
wire() {
sessionStorage.setItem('pro::wire-modal::open', '1');
this.modalService
.create(WireCreatorComponent, this.currentChannel, {
onComplete: () => {},
onComplete: () => {
sessionStorage.removeItem('pro::wire-modal::open')
},
})
.onDidDismiss(() => {
sessionStorage.removeItem('pro::wire-modal::open')
})
.present();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment