mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
alternative to https://github.com/lensapp/lens/pull/7187
Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
parent
a7181047d5
commit
883ad8dd9c
@ -21,7 +21,9 @@ const currentKubeObjectInDetailsInjectable = getInjectable({
|
||||
const apiManager = di.inject(apiManagerInjectable);
|
||||
|
||||
return asyncComputed({
|
||||
getValueFromObservedPromise: async (): Promise<CurrentKubeObject> => {
|
||||
betweenUpdates: "show-latest-value",
|
||||
|
||||
async getValueFromObservedPromise(): Promise<CurrentKubeObject> {
|
||||
const path = urlParam.get();
|
||||
const store = apiManager.getStore(path);
|
||||
|
||||
@ -30,7 +32,7 @@ const currentKubeObjectInDetailsInjectable = getInjectable({
|
||||
}
|
||||
|
||||
try {
|
||||
const object = await store.loadFromPath(path);
|
||||
const object = store.getByPath(path) ?? await store.loadFromPath(path);
|
||||
|
||||
return { object };
|
||||
} catch (error) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user