Commit a3cb83cc authored by PECQUOT's avatar PECQUOT
Browse files

[fix] PlatformService: Set specific error when Firefox is in private mode or...

[fix] PlatformService: Set specific error when Firefox is in private mode or history never remembered (see Mantis Ifremer #56441)
parent ddc0038b
......@@ -8,6 +8,7 @@ import {Keyboard} from '@ionic-native/keyboard/ngx';
import {LocalSettingsService} from './local-settings.service';
import {CacheService} from 'ionic-cache';
import {AudioProvider} from '../../shared/audio/audio';
import {Platform as CdkPlatform} from '@angular/cdk/platform';
import {InAppBrowser} from '@ionic-native/in-app-browser/ngx';
import {isEmptyArray, isNil, isNotNil, isNotNilOrBlank} from '../../shared/functions';
......@@ -47,6 +48,7 @@ export class PlatformService {
constructor(
private platform: Platform,
private cdkPlatform: CdkPlatform,
private toastController: ToastController,
private translate: TranslateService,
private dateAdapter: MomentDateAdapter,
......@@ -356,6 +358,10 @@ export class PlatformService {
console.error('[platform] Failed starting the platform! ', err);
let message = err && err.message || err;
const detailsMessage = err && (err.details && err.details.message || err.details);
// Set specific error when Firefox is in private mode or history never remembered (see Mantis Ifremer #56441)
if (err.code === 11 && this.cdkPlatform.FIREFOX) {
message = 'ERROR.FIREFOX_NO_STORAGE';
}
if (this.translate) {
message = await this.translate.get(message).toPromise();
if (err && err.code) {
......
......@@ -509,7 +509,8 @@
"SYNCHRONIZE_ENTITY_ERROR": "Cannot synchronize. <small><br/>If the problem persists, please contact your administrator.</small>",
"LOAD_ERROR": "Error while loading",
"SAVE_ERROR": "Error while saving",
"SUBSCRIBE_ERROR": "Error while subscribe to changes"
"SUBSCRIBE_ERROR": "Error while subscribe to changes",
"FIREFOX_NO_STORAGE": "The application cannot run with Firefox in 'private' mode or without keeping navigation history"
},
"CONFIRM": {
"ALERT_HEADER": "Confirmation",
......
......@@ -509,7 +509,8 @@
"SYNCHRONIZE_ENTITY_ERROR": "Cannot synchronize. <small><br/>If the problem persists, please contact your administrator.</small>",
"LOAD_ERROR": "Error while loading",
"SAVE_ERROR": "Error while saving",
"SUBSCRIBE_ERROR": "Error while subscribe to changes"
"SUBSCRIBE_ERROR": "Error while subscribe to changes",
"FIREFOX_NO_STORAGE": "The application cannot run with Firefox in 'private' mode or without keeping navigation history"
},
"CONFIRM": {
"ALERT_HEADER": "Confirmation",
......
......@@ -504,7 +504,8 @@
"SYNCHRONIZE_ENTITY_ERROR": "Synchronisation impossible. <small><br/>Si le problème persiste, veuillez contacter votre administrateur.</small>",
"LOAD_ERROR": "Erreur de chargement",
"SAVE_ERROR": "Erreur de sauvegarde",
"SUBSCRIBE_ERROR": "Echec de l'abonnement distant aux modifications"
"SUBSCRIBE_ERROR": "Echec de l'abonnement distant aux modifications",
"FIREFOX_NO_STORAGE": "L'application ne peut pas fonctionner sur Firefox en mode 'navigation privée' ou si la conservation de l'historique est désactivée"
},
"CONFIRM": {
"ALERT_HEADER": "Confirmation",
......
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