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

Using syncKubeconfigEntries.replace() (#6837)

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2022-12-28 13:18:22 +03:00 committed by GitHub
parent 8156936b82
commit 29d2e1fb86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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