Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.

Commit

Permalink
Issue #SB-3723 fix : Show the toast when no internet in QR code search
Browse files Browse the repository at this point in the history
  • Loading branch information
vinayagasundar committed May 25, 2018
1 parent 845a1ae commit f0dbf27
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/pages/resources/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { CourseDetailPage } from '../course-detail/course-detail';
import { CollectionDetailsPage } from '../collection-details/collection-details';
import { ContentDetailsPage } from '../content-details/content-details';
import { TranslateService } from '@ngx-translate/core';
import { Network } from '@ionic-native/network';

@Component({
selector: 'page-resources',
Expand Down Expand Up @@ -96,7 +97,8 @@ export class ResourcesPage implements OnInit {
private toastCtrl: ToastController,
private preference: SharedPreferences,
private translate: TranslateService,
private zone: NgZone
private zone: NgZone,
private network: Network
) {
this.contentService = contentService;
this.authService = authService;
Expand Down Expand Up @@ -366,12 +368,11 @@ export class ResourcesPage implements OnInit {
that.showContentDetails(data.result);
}, (error) => {
console.log("Error " + error);
let toast = that.toastCtrl.create({
message: "No content found associated with that QR code",
duration: 3000
})

toast.present();
if (that.network.type === 'none') {
that.getMessageByConst('ERROR_NO_INTERNET_MESSAGE');
} else {
that.getMessageByConst('UNKNOWN_QR');
}
});
}
}
Expand Down

0 comments on commit f0dbf27

Please sign in to comment.