MOBILE-4249 messages: Fix context menu items duplicated
parent
77fb8f7502
commit
6b9b956474
|
@ -12,7 +12,7 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core';
|
||||||
import { IonRefresher } from '@ionic/angular';
|
import { IonRefresher } from '@ionic/angular';
|
||||||
import { CoreSites } from '@services/sites';
|
import { CoreSites } from '@services/sites';
|
||||||
import {
|
import {
|
||||||
|
@ -29,6 +29,7 @@ import { ActivatedRoute } from '@angular/router';
|
||||||
import { Translate } from '@singletons';
|
import { Translate } from '@singletons';
|
||||||
import { CoreScreen } from '@services/screen';
|
import { CoreScreen } from '@services/screen';
|
||||||
import { CoreNavigator } from '@services/navigator';
|
import { CoreNavigator } from '@services/navigator';
|
||||||
|
import { CoreSplitViewComponent } from '@components/split-view/split-view';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays the list of contacts.
|
* Page that displays the list of contacts.
|
||||||
|
@ -40,6 +41,8 @@ import { CoreNavigator } from '@services/navigator';
|
||||||
})
|
})
|
||||||
export class AddonMessagesContacts35Page implements OnInit, OnDestroy {
|
export class AddonMessagesContacts35Page implements OnInit, OnDestroy {
|
||||||
|
|
||||||
|
@ViewChild(CoreSplitViewComponent) splitView!: CoreSplitViewComponent;
|
||||||
|
|
||||||
protected searchingMessages: string;
|
protected searchingMessages: string;
|
||||||
protected loadingMessages: string;
|
protected loadingMessages: string;
|
||||||
protected siteId: string;
|
protected siteId: string;
|
||||||
|
@ -244,7 +247,9 @@ export class AddonMessagesContacts35Page implements OnInit, OnDestroy {
|
||||||
const path = CoreNavigator.getRelativePathToParent('/messages/contacts-35') + `discussion/user/${discussionUserId}`;
|
const path = CoreNavigator.getRelativePathToParent('/messages/contacts-35') + `discussion/user/${discussionUserId}`;
|
||||||
|
|
||||||
// @todo Check why this is failing on ngInit.
|
// @todo Check why this is failing on ngInit.
|
||||||
CoreNavigator.navigate(path);
|
CoreNavigator.navigate(path, {
|
||||||
|
reset: CoreScreen.isTablet && !!this.splitView && !this.splitView.isNested,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core';
|
||||||
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
||||||
import { CoreSites } from '@services/sites';
|
import { CoreSites } from '@services/sites';
|
||||||
import {
|
import {
|
||||||
|
@ -24,6 +24,7 @@ import { CoreNavigator } from '@services/navigator';
|
||||||
import { CoreScreen } from '@services/screen';
|
import { CoreScreen } from '@services/screen';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
import { IonRefresher } from '@ionic/angular';
|
import { IonRefresher } from '@ionic/angular';
|
||||||
|
import { CoreSplitViewComponent } from '@components/split-view/split-view';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays contacts and contact requests.
|
* Page that displays contacts and contact requests.
|
||||||
|
@ -37,6 +38,8 @@ import { IonRefresher } from '@ionic/angular';
|
||||||
})
|
})
|
||||||
export class AddonMessagesContactsPage implements OnInit, OnDestroy {
|
export class AddonMessagesContactsPage implements OnInit, OnDestroy {
|
||||||
|
|
||||||
|
@ViewChild(CoreSplitViewComponent) splitView!: CoreSplitViewComponent;
|
||||||
|
|
||||||
selected: 'confirmed' | 'requests' = 'confirmed';
|
selected: 'confirmed' | 'requests' = 'confirmed';
|
||||||
requestsBadge = '';
|
requestsBadge = '';
|
||||||
selectedUserId?: number; // User id of the conversation opened in the split view.
|
selectedUserId?: number; // User id of the conversation opened in the split view.
|
||||||
|
@ -292,7 +295,9 @@ export class AddonMessagesContactsPage implements OnInit, OnDestroy {
|
||||||
this.selectedUserId = userId;
|
this.selectedUserId = userId;
|
||||||
|
|
||||||
const path = CoreNavigator.getRelativePathToParent('/messages/contacts') + `discussion/user/${userId}`;
|
const path = CoreNavigator.getRelativePathToParent('/messages/contacts') + `discussion/user/${userId}`;
|
||||||
CoreNavigator.navigate(path);
|
CoreNavigator.navigate(path, {
|
||||||
|
reset: CoreScreen.isTablet && !!this.splitView && !this.splitView.isNested,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core';
|
||||||
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
||||||
import { CoreSites } from '@services/sites';
|
import { CoreSites } from '@services/sites';
|
||||||
import {
|
import {
|
||||||
|
@ -34,6 +34,7 @@ import { CoreNavigator } from '@services/navigator';
|
||||||
import { CoreScreen } from '@services/screen';
|
import { CoreScreen } from '@services/screen';
|
||||||
import { CoreMainMenuDeepLinkManager } from '@features/mainmenu/classes/deep-link-manager';
|
import { CoreMainMenuDeepLinkManager } from '@features/mainmenu/classes/deep-link-manager';
|
||||||
import { CorePlatform } from '@services/platform';
|
import { CorePlatform } from '@services/platform';
|
||||||
|
import { CoreSplitViewComponent } from '@components/split-view/split-view';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays the list of discussions.
|
* Page that displays the list of discussions.
|
||||||
|
@ -45,6 +46,8 @@ import { CorePlatform } from '@services/platform';
|
||||||
})
|
})
|
||||||
export class AddonMessagesDiscussions35Page implements OnInit, OnDestroy {
|
export class AddonMessagesDiscussions35Page implements OnInit, OnDestroy {
|
||||||
|
|
||||||
|
@ViewChild(CoreSplitViewComponent) splitView!: CoreSplitViewComponent;
|
||||||
|
|
||||||
protected newMessagesObserver: CoreEventObserver;
|
protected newMessagesObserver: CoreEventObserver;
|
||||||
protected readChangedObserver: CoreEventObserver;
|
protected readChangedObserver: CoreEventObserver;
|
||||||
protected appResumeSubscription: Subscription;
|
protected appResumeSubscription: Subscription;
|
||||||
|
@ -264,7 +267,10 @@ export class AddonMessagesDiscussions35Page implements OnInit, OnDestroy {
|
||||||
|
|
||||||
const path = CoreNavigator.getRelativePathToParent('/messages/index') + `discussion/user/${discussionUserId}`;
|
const path = CoreNavigator.getRelativePathToParent('/messages/index') + `discussion/user/${discussionUserId}`;
|
||||||
|
|
||||||
await CoreNavigator.navigate(path, { params });
|
await CoreNavigator.navigate(path, {
|
||||||
|
params,
|
||||||
|
reset: CoreScreen.isTablet && !!this.splitView && !this.splitView.isNested,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -38,6 +38,7 @@ import { CoreNavigator } from '@services/navigator';
|
||||||
import { CoreScreen } from '@services/screen';
|
import { CoreScreen } from '@services/screen';
|
||||||
import { CoreMainMenuDeepLinkManager } from '@features/mainmenu/classes/deep-link-manager';
|
import { CoreMainMenuDeepLinkManager } from '@features/mainmenu/classes/deep-link-manager';
|
||||||
import { CorePlatform } from '@services/platform';
|
import { CorePlatform } from '@services/platform';
|
||||||
|
import { CoreSplitViewComponent } from '@components/split-view/split-view';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays the list of conversations, including group conversations.
|
* Page that displays the list of conversations, including group conversations.
|
||||||
|
@ -49,6 +50,8 @@ import { CorePlatform } from '@services/platform';
|
||||||
})
|
})
|
||||||
export class AddonMessagesGroupConversationsPage implements OnInit, OnDestroy {
|
export class AddonMessagesGroupConversationsPage implements OnInit, OnDestroy {
|
||||||
|
|
||||||
|
@ViewChild(CoreSplitViewComponent) splitView!: CoreSplitViewComponent;
|
||||||
|
|
||||||
@ViewChild(IonContent) content?: IonContent;
|
@ViewChild(IonContent) content?: IonContent;
|
||||||
@ViewChild('favlist') favListEl?: ElementRef;
|
@ViewChild('favlist') favListEl?: ElementRef;
|
||||||
@ViewChild('grouplist') groupListEl?: ElementRef;
|
@ViewChild('grouplist') groupListEl?: ElementRef;
|
||||||
|
@ -526,7 +529,10 @@ export class AddonMessagesGroupConversationsPage implements OnInit, OnDestroy {
|
||||||
const path = CoreNavigator.getRelativePathToParent('/messages/group-conversations') + 'discussion/' +
|
const path = CoreNavigator.getRelativePathToParent('/messages/group-conversations') + 'discussion/' +
|
||||||
(conversationId ? conversationId : `user/${userId}`);
|
(conversationId ? conversationId : `user/${userId}`);
|
||||||
|
|
||||||
await CoreNavigator.navigate(path, { params });
|
await CoreNavigator.navigate(path, {
|
||||||
|
params,
|
||||||
|
reset: CoreScreen.isTablet && !!this.splitView && !this.splitView.isNested,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
import { Component, OnDestroy } from '@angular/core';
|
import { Component, OnDestroy, ViewChild } from '@angular/core';
|
||||||
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
||||||
import { CoreSites } from '@services/sites';
|
import { CoreSites } from '@services/sites';
|
||||||
import {
|
import {
|
||||||
|
@ -25,6 +25,7 @@ import { CoreDomUtils } from '@services/utils/dom';
|
||||||
import { CoreApp } from '@services/app';
|
import { CoreApp } from '@services/app';
|
||||||
import { CoreNavigator } from '@services/navigator';
|
import { CoreNavigator } from '@services/navigator';
|
||||||
import { CoreScreen } from '@services/screen';
|
import { CoreScreen } from '@services/screen';
|
||||||
|
import { CoreSplitViewComponent } from '@components/split-view/split-view';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page for searching users.
|
* Page for searching users.
|
||||||
|
@ -35,6 +36,8 @@ import { CoreScreen } from '@services/screen';
|
||||||
})
|
})
|
||||||
export class AddonMessagesSearchPage implements OnDestroy {
|
export class AddonMessagesSearchPage implements OnDestroy {
|
||||||
|
|
||||||
|
@ViewChild(CoreSplitViewComponent) splitView!: CoreSplitViewComponent;
|
||||||
|
|
||||||
disableSearch = false;
|
disableSearch = false;
|
||||||
displaySearching = false;
|
displaySearching = false;
|
||||||
displayResults = false;
|
displayResults = false;
|
||||||
|
@ -260,7 +263,9 @@ export class AddonMessagesSearchPage implements OnDestroy {
|
||||||
const path = CoreNavigator.getRelativePathToParent('/messages/search') + 'discussion/' +
|
const path = CoreNavigator.getRelativePathToParent('/messages/search') + 'discussion/' +
|
||||||
(conversationId ? conversationId : `user/${userId}`);
|
(conversationId ? conversationId : `user/${userId}`);
|
||||||
|
|
||||||
CoreNavigator.navigate(path);
|
CoreNavigator.navigate(path, {
|
||||||
|
reset: CoreScreen.isTablet && !!this.splitView && !this.splitView.isNested,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue