Skip to content

Commit

Permalink
Issue #SH-22 merge: Merge pull request #997 from AmiableAnil/Release-…
Browse files Browse the repository at this point in the history
…3.1.0-routerIssue

Release 3.1.0 router
  • Loading branch information
AmiableAnil authored Jun 29, 2020
2 parents c0e2e6c + d954fab commit 5eebeb5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/app/app.constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ export class PreferenceKey {
public static readonly COACH_MARK_SEEN = 'coach_mark_seen';
public static readonly PAGE_ASSEMBLE_ORGANISATION_ID = 'page_assemble_organisation_id';
public static readonly CAMPAIGN_PARAMETERS = 'campaign_parameters';
public static readonly CREATE_GROUP_INFO_POPUP = 'create_group_info_popup';
}

export class GenericAppConfig {
Expand Down
17 changes: 13 additions & 4 deletions src/app/my-groups/my-groups.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { Component, OnInit, Inject, OnDestroy } from '@angular/core';
import { Router, NavigationExtras } from '@angular/router';

import { AppHeaderService } from '@app/services/app-header.service';
import { RouterLinks } from '../app.constant';
import { AuthService, ClassRoomService, ClassRoom } from '@project-sunbird/sunbird-sdk';
import { RouterLinks, PreferenceKey } from '../app.constant';
import { AuthService, ClassRoomService, ClassRoom, SharedPreferences } from '@project-sunbird/sunbird-sdk';
import { LoginHandlerService } from '@app/services/login-handler.service';
import { CommonUtilService } from '@app/services';
import { PopoverController } from '@ionic/angular';
Expand All @@ -23,12 +23,13 @@ export class MyGroupsPage implements OnInit, OnDestroy {
constructor(
@Inject('AUTH_SERVICE') public authService: AuthService,
@Inject('CLASS_ROOM_SERVICE') public classRoomService: ClassRoomService,
@Inject('SHARED_PREFERENCES') private preferences: SharedPreferences,
private headerService: AppHeaderService,
private router: Router,
private loginHandlerService: LoginHandlerService,
private commonUtilService: CommonUtilService,
private popoverCtrl: PopoverController
) { }
) { }

ngOnInit() {
this.checkUserLoggedIn();
Expand All @@ -47,6 +48,14 @@ export class MyGroupsPage implements OnInit, OnDestroy {
this.fetchGroupList();
}

async ionViewDidEnter() {
const groupInfoScreen = await this.preferences.getBoolean(PreferenceKey.CREATE_GROUP_INFO_POPUP).toPromise();
if (!groupInfoScreen) {
this.openinfopopup();
this.preferences.putBoolean(PreferenceKey.CREATE_GROUP_INFO_POPUP, true).toPromise().then();
}
}

ngOnDestroy() {
if (this.headerObservable) {
this.headerObservable.unsubscribe();
Expand All @@ -66,7 +75,7 @@ export class MyGroupsPage implements OnInit, OnDestroy {
}

login() {
this.loginHandlerService.signIn({skipRootNavigation: true});
this.loginHandlerService.signIn({ skipRootNavigation: true });
}

async fetchGroupList() {
Expand Down

0 comments on commit 5eebeb5

Please sign in to comment.