mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Keep up-to-date resource in the details view (Drawer) (#7224)
* alternative to https://github.com/lensapp/lens/pull/7187 Signed-off-by: Roman <ixrock@gmail.com> * update snapshots with `jest src -u` from `packages/core` Signed-off-by: Roman <ixrock@gmail.com> * skipping some tests cause i have no idea how to fix those and what is wrong Signed-off-by: Roman <ixrock@gmail.com> * fix tests Signed-off-by: Roman <ixrock@gmail.com> --------- Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
1 parent
a63f737adb
commit
79a4eb32a3
3 files changed
+39
-24
No files matched your search
+4
-2
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user