1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00
lens/src/common/front-end-routing/routes/preferences/extension/navigate-to-extension-preferences.injectable.ts
Alex Andreev 0e1c507ce1
Do not affect history while navigating (#5741)
to Preferences extensions tabs

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
2022-06-28 13:47:55 +03:00

27 lines
916 B
TypeScript

/**
* Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { getInjectable } from "@ogre-tools/injectable";
import extensionPreferencesRouteInjectable from "./extension-preferences-route.injectable";
import { navigateToRouteInjectionToken } from "../../../navigate-to-route-injection-token";
const navigateToExtensionPreferencesInjectable = getInjectable({
id: "navigate-to-extension-preferences",
instantiate: (di) => {
const navigateToRoute = di.inject(navigateToRouteInjectionToken);
const route = di.inject(extensionPreferencesRouteInjectable);
return (extensionId: string, tabId?: string) => navigateToRoute(route, {
parameters: {
extensionId,
tabId,
},
withoutAffectingBackButton: true,
});
},
});
export default navigateToExtensionPreferencesInjectable;