Skip to content

Commit 17fa1b3

Browse files
committed
fix: nit requested changes
1 parent 8a9660e commit 17fa1b3

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

projects/common/src/time/time-range.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,12 @@ export class TimeRangeService {
157157
}
158158

159159
public toQueryParams(timeRange: TimeRange, refreshTimeOnNavigationParam?: boolean): QueryParamObject {
160-
let queryParams: QueryParamObject = {
160+
const queryParams: QueryParamObject = {
161161
[TimeRangeService.TIME_RANGE_QUERY_PARAM]: timeRange.toUrlString()
162162
};
163163

164164
if (refreshTimeOnNavigationParam) {
165-
queryParams = { ...queryParams, [TimeRangeService.REFRESH_ON_NAVIGATION]: true };
165+
return { ...queryParams, [TimeRangeService.REFRESH_ON_NAVIGATION]: true };
166166
}
167167

168168
return queryParams;

projects/components/src/navigation/nav-item/nav-item.component.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,22 +58,17 @@ export class NavItemComponent {
5858
public readonly navItemViewStyle?: NavViewStyle;
5959

6060
public buildNavigationParam = (item: NavItemLinkConfig): NavigationParams => {
61-
let navParams: NavigationParams = {
61+
const navParams: NavigationParams = {
6262
navType: NavigationParamsType.InApp,
6363
path: item.matchPaths[0],
6464
relativeTo: this.activatedRoute,
6565
replaceCurrentHistory: item.replaceCurrentHistory
6666
};
6767

6868
if (this.config.pageLevelTimeRangeIsEnabled && this.config.timeRangeResolver) {
69-
const timeRange = this.config.timeRangeResolver();
70-
const timeRangeQueryParam = this.timeRangeService.toQueryParams(timeRange, true);
71-
72-
navParams = {
69+
return {
7370
...navParams,
74-
queryParams: {
75-
...timeRangeQueryParam
76-
}
71+
queryParams: this.timeRangeService.toQueryParams(this.config.timeRangeResolver(), true)
7772
};
7873
}
7974

0 commit comments

Comments
 (0)