MOBILE-4059 core: Fix support help for guests

main
Noel De Martin 2022-11-28 17:18:16 +01:00
parent 6ff5868e9d
commit ad86d6e6e0
3 changed files with 10 additions and 2 deletions

View File

@ -138,6 +138,7 @@ export class CoreLoginCredentialsPage implements OnInit, OnDestroy {
CoreUserSupport.showHelp(
Translate.instant('core.login.credentialshelp'),
Translate.instant('core.login.credentialssupportsubject'),
this.supportConfig,
);
}

View File

@ -149,6 +149,7 @@ export class CoreLoginReconnectPage implements OnInit, OnDestroy {
CoreUserSupport.showHelp(
Translate.instant('core.login.reconnecthelp'),
Translate.instant('core.login.reconnectsupportsubject'),
this.supportConfig,
);
}

View File

@ -25,6 +25,7 @@ import { CoreSubscriptions } from '@singletons/subscriptions';
import { AlertButton } from '@ionic/angular';
import { CoreDomUtils } from '@services/utils/dom';
import { CoreLang } from '@services/lang';
import { CoreUserNullSupportConfig } from '@features/user/classes/support/null-support-config';
/**
* Handle site support.
@ -57,10 +58,15 @@ export class CoreUserSupportService {
* @param message Help message.
* @param supportSubject Support subject.
*/
showHelp(message: string, supportSubject: string): void {
const supportConfig = CoreUserAuthenticatedSupportConfig.forCurrentSite();
showHelp(message: string, supportSubject: string, supportConfig?: CoreUserSupportConfig): void {
const buttons: (AlertButton | string)[] = [];
if (!supportConfig) {
const site = CoreSites.getCurrentSite();
supportConfig = site ? new CoreUserAuthenticatedSupportConfig(site) : new CoreUserNullSupportConfig();
}
if (supportConfig.canContactSupport()) {
buttons.push({
text: Translate.instant('core.contactsupport'),