1
0
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:
Sebastian Malton 2021-04-30 09:07:44 -04:00
parent 9f3d6e3e3c
commit 05fbdb070d
2 changed files with 2 additions and 6 deletions

View File

@ -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();
}
}

View File

@ -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 }));