mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 14:03:48 +03:00
Fixed breadcrumbs when going from analytics to member
refs https://github.com/TryGhost/Team/issues/2140
This commit is contained in:
parent
310459c3b9
commit
4501c82820
@ -34,7 +34,19 @@ export default class MembersRoute extends AdminRoute {
|
||||
controller.fetchMemberTask.perform(member.id);
|
||||
}
|
||||
|
||||
if (transition.from?.name === 'members.index' && transition.from?.parent?.name === 'members') {
|
||||
if (transition.from?.name === 'posts.analytics') {
|
||||
// Sadly transition.from.params is not reliable to use (not populated on transitions)
|
||||
const oldParams = transition.router?.oldState?.params['posts.analytics'] ?? {};
|
||||
|
||||
// We need to store analytics in 'this' to have it accessible for the member route
|
||||
this.fromAnalytics = Object.values(oldParams);
|
||||
controller.fromAnalytics = this.fromAnalytics;
|
||||
} else if (transition.from?.metadata?.fromAnalytics) {
|
||||
// Handle returning from member route
|
||||
const fromAnalytics = transition.from?.metadata.fromAnalytics ?? null;
|
||||
controller.fromAnalytics = fromAnalytics;
|
||||
this.fromAnalytics = fromAnalytics;
|
||||
} else if (transition.from?.name === 'members.index' && transition.from?.parent?.name === 'members') {
|
||||
const fromAnalytics = transition.from?.parent?.metadata.fromAnalytics ?? null;
|
||||
controller.fromAnalytics = fromAnalytics;
|
||||
this.fromAnalytics = fromAnalytics;
|
||||
|
Loading…
Reference in New Issue
Block a user