mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
don't clear UserStore on non-existant preference field, fix unlinking not removing items from source
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
9f3d6e3e3c
commit
05fbdb070d
@ -238,23 +238,17 @@ export class UserStore extends BaseStore<UserStoreModel> {
|
||||
this.kubectlBinariesPath = preferences.kubectlBinariesPath;
|
||||
this.openAtLogin = preferences.openAtLogin;
|
||||
|
||||
this.hiddenTableColumns.clear();
|
||||
|
||||
if (preferences.hiddenTableColumns) {
|
||||
this.hiddenTableColumns.replace(
|
||||
preferences.hiddenTableColumns
|
||||
.map(([tableId, columnIds]) => [tableId, new ObservableToggleSet(columnIds)])
|
||||
);
|
||||
} else {
|
||||
this.hiddenTableColumns.clear();
|
||||
}
|
||||
|
||||
if (preferences.syncKubeconfigEntries) {
|
||||
this.syncKubeconfigEntries.replace(
|
||||
preferences.syncKubeconfigEntries.map(({ filePath, ...rest }) => [filePath, rest])
|
||||
);
|
||||
} else {
|
||||
this.syncKubeconfigEntries.clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -242,6 +242,8 @@ async function watchFileChanges(filePath: string, port: number): Promise<[ICompu
|
||||
})
|
||||
.on("unlink", (childFilePath) => {
|
||||
stoppers.get(childFilePath)();
|
||||
stoppers.delete(childFilePath);
|
||||
rootSource.delete(childFilePath);
|
||||
})
|
||||
.on("error", error => logger.error(`${logPrefix} watching file/folder failed: ${error}`, { filePath }));
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user