MOBILE-4059 core: Fix support help for guests
parent
6ff5868e9d
commit
ad86d6e6e0
|
@ -138,6 +138,7 @@ export class CoreLoginCredentialsPage implements OnInit, OnDestroy {
|
||||||
CoreUserSupport.showHelp(
|
CoreUserSupport.showHelp(
|
||||||
Translate.instant('core.login.credentialshelp'),
|
Translate.instant('core.login.credentialshelp'),
|
||||||
Translate.instant('core.login.credentialssupportsubject'),
|
Translate.instant('core.login.credentialssupportsubject'),
|
||||||
|
this.supportConfig,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -149,6 +149,7 @@ export class CoreLoginReconnectPage implements OnInit, OnDestroy {
|
||||||
CoreUserSupport.showHelp(
|
CoreUserSupport.showHelp(
|
||||||
Translate.instant('core.login.reconnecthelp'),
|
Translate.instant('core.login.reconnecthelp'),
|
||||||
Translate.instant('core.login.reconnectsupportsubject'),
|
Translate.instant('core.login.reconnectsupportsubject'),
|
||||||
|
this.supportConfig,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ import { CoreSubscriptions } from '@singletons/subscriptions';
|
||||||
import { AlertButton } from '@ionic/angular';
|
import { AlertButton } from '@ionic/angular';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
import { CoreLang } from '@services/lang';
|
import { CoreLang } from '@services/lang';
|
||||||
|
import { CoreUserNullSupportConfig } from '@features/user/classes/support/null-support-config';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle site support.
|
* Handle site support.
|
||||||
|
@ -57,10 +58,15 @@ export class CoreUserSupportService {
|
||||||
* @param message Help message.
|
* @param message Help message.
|
||||||
* @param supportSubject Support subject.
|
* @param supportSubject Support subject.
|
||||||
*/
|
*/
|
||||||
showHelp(message: string, supportSubject: string): void {
|
showHelp(message: string, supportSubject: string, supportConfig?: CoreUserSupportConfig): void {
|
||||||
const supportConfig = CoreUserAuthenticatedSupportConfig.forCurrentSite();
|
|
||||||
const buttons: (AlertButton | string)[] = [];
|
const buttons: (AlertButton | string)[] = [];
|
||||||
|
|
||||||
|
if (!supportConfig) {
|
||||||
|
const site = CoreSites.getCurrentSite();
|
||||||
|
|
||||||
|
supportConfig = site ? new CoreUserAuthenticatedSupportConfig(site) : new CoreUserNullSupportConfig();
|
||||||
|
}
|
||||||
|
|
||||||
if (supportConfig.canContactSupport()) {
|
if (supportConfig.canContactSupport()) {
|
||||||
buttons.push({
|
buttons.push({
|
||||||
text: Translate.instant('core.contactsupport'),
|
text: Translate.instant('core.contactsupport'),
|
||||||
|
|
Loading…
Reference in New Issue