MOBILE-4623 forum: Fix issues with single activity format
parent
5643e89c95
commit
2e09325eef
|
@ -58,6 +58,7 @@ import {
|
||||||
ADDON_MOD_FORUM_MARK_READ_EVENT,
|
ADDON_MOD_FORUM_MARK_READ_EVENT,
|
||||||
ADDON_MOD_FORUM_REPLY_DISCUSSION_EVENT,
|
ADDON_MOD_FORUM_REPLY_DISCUSSION_EVENT,
|
||||||
} from '../../constants';
|
} from '../../constants';
|
||||||
|
import { CoreCourseContentsPage } from '@features/course/pages/contents/contents';
|
||||||
|
|
||||||
type SortType = 'flat-newest' | 'flat-oldest' | 'nested';
|
type SortType = 'flat-newest' | 'flat-oldest' | 'nested';
|
||||||
|
|
||||||
|
@ -133,6 +134,7 @@ export class AddonModForumDiscussionPage implements OnInit, AfterViewInit, OnDes
|
||||||
@Optional() protected splitView: CoreSplitViewComponent,
|
@Optional() protected splitView: CoreSplitViewComponent,
|
||||||
protected elementRef: ElementRef,
|
protected elementRef: ElementRef,
|
||||||
protected route: ActivatedRoute,
|
protected route: ActivatedRoute,
|
||||||
|
@Optional() protected courseContentsPage?: CoreCourseContentsPage,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
get isMobile(): boolean {
|
get isMobile(): boolean {
|
||||||
|
@ -316,7 +318,7 @@ export class AddonModForumDiscussionPage implements OnInit, AfterViewInit, OnDes
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.splitView?.outletActivated) {
|
if (this.splitView?.outletActivated) {
|
||||||
CoreNavigator.navigate('../');
|
CoreNavigator.navigate((this.courseContentsPage ? '../' : '') + '../');
|
||||||
} else {
|
} else {
|
||||||
CoreNavigator.back();
|
CoreNavigator.back();
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,6 +51,7 @@ import {
|
||||||
ADDON_MOD_FORUM_COMPONENT,
|
ADDON_MOD_FORUM_COMPONENT,
|
||||||
ADDON_MOD_FORUM_NEW_DISCUSSION_EVENT,
|
ADDON_MOD_FORUM_NEW_DISCUSSION_EVENT,
|
||||||
} from '../../constants';
|
} from '../../constants';
|
||||||
|
import { CoreCourseContentsPage } from '@features/course/pages/contents/contents';
|
||||||
|
|
||||||
type NewDiscussionData = {
|
type NewDiscussionData = {
|
||||||
subject: string;
|
subject: string;
|
||||||
|
@ -114,7 +115,11 @@ export class AddonModForumNewDiscussionPage implements OnInit, OnDestroy, CanLea
|
||||||
protected initialGroupId?: number;
|
protected initialGroupId?: number;
|
||||||
protected logView: () => void;
|
protected logView: () => void;
|
||||||
|
|
||||||
constructor(protected route: ActivatedRoute, @Optional() protected splitView: CoreSplitViewComponent) {
|
constructor(
|
||||||
|
protected route: ActivatedRoute,
|
||||||
|
@Optional() protected splitView: CoreSplitViewComponent,
|
||||||
|
@Optional() protected courseContentsPage?: CoreCourseContentsPage,
|
||||||
|
) {
|
||||||
this.logView = CoreTime.once(() => {
|
this.logView = CoreTime.once(() => {
|
||||||
CoreAnalytics.logEvent({
|
CoreAnalytics.logEvent({
|
||||||
type: CoreAnalyticsEventType.VIEW_ITEM,
|
type: CoreAnalyticsEventType.VIEW_ITEM,
|
||||||
|
@ -678,7 +683,7 @@ export class AddonModForumNewDiscussionPage implements OnInit, OnDestroy, CanLea
|
||||||
*/
|
*/
|
||||||
protected goBack(): void {
|
protected goBack(): void {
|
||||||
if (this.splitView?.outletActivated) {
|
if (this.splitView?.outletActivated) {
|
||||||
CoreNavigator.navigate('../../');
|
CoreNavigator.navigate((this.courseContentsPage ? '../' : '') + '../../');
|
||||||
} else {
|
} else {
|
||||||
CoreNavigator.back();
|
CoreNavigator.back();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue