1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Using syncKubeconfigEntries.replace()

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2022-12-28 10:49:51 +03:00
parent 8156936b82
commit 083affddbc

View File

@ -3,7 +3,7 @@
* Licensed under MIT License. See LICENSE in root directory for more information.
*/
import { withInjectables } from "@ogre-tools/injectable-react";
import { action, computed, makeObservable, observable, reaction } from "mobx";
import { computed, makeObservable, observable, reaction } from "mobx";
import { disposeOnUnmount, observer } from "mobx-react";
import React from "react";
import { Notice } from "../../../../../../renderer/components/+extensions/notice";
@ -59,11 +59,7 @@ class NonInjectedKubeconfigSync extends React.Component<Dependencies> {
reaction(
() => Array.from(this.syncs.entries(), ([filePath, kind]) => tuple.from(filePath, kind)),
syncs => {
action(() => {
for (const [path] of syncs) {
this.props.userStore.syncKubeconfigEntries.set(path, {});
}
});
this.props.userStore.syncKubeconfigEntries.replace(syncs);
},
),
]);