diff --git a/main-process/Settings.ts b/main-process/Settings.ts index 4253774..7b9502b 100644 --- a/main-process/Settings.ts +++ b/main-process/Settings.ts @@ -109,9 +109,15 @@ export default class Settings { } pushRecentWorkspace(path: string) { - if (this.model.recentWorkspaces.indexOf(path) < 0) { - this.model.recentWorkspaces.unshift(path); - this.save(); + var list = this.model.recentWorkspaces; + if (list.indexOf(path) >= 0) { + list = list.filter((value) => value !== path); } + list.unshift(path); + while(list.length > 10) { + list.pop(); + } + this.model.recentWorkspaces = list; + this.save(); } } diff --git a/package.json b/package.json index 9b70686..9309714 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "behavior3editor", - "version": "0.1.0", + "version": "0.1.1", "description": "行为树编辑器", "main": "./dist/main.js", "scripts": { diff --git a/render-process/Properties.tsx b/render-process/Properties.tsx index a9cbda1..b1a65ea 100644 --- a/render-process/Properties.tsx +++ b/render-process/Properties.tsx @@ -344,10 +344,10 @@ export default class Properties extends Component { { - const value = e.target.value?.toLowerCase(); - this.handleOnSearch(value); - }} + // onChange={(e)=>{ + // const value = e.target.value?.toLowerCase(); + // this.handleOnSearch(value); + // }} onSearch={ (value,event)=>{ this.handleOnSearch(value?.toLowerCase());