fix: removed dev tools, updated sidebar links, fixed file deletion.

- Removed ability to open developer tools in main window.
- Added and removed a link to the "/files" route in the Sidebar component.
- Fixed file deletion logic to correctly delete files from both the database and the file system.
This commit is contained in:
kangfenmao 2024-09-14 21:28:17 +08:00
parent 29826ff091
commit 71a35ccd44
3 changed files with 6 additions and 7 deletions

View File

@ -40,7 +40,6 @@ export function createMainWindow() {
}
})
mainWindow.webContents.openDevTools()
mainWindowState.manage(mainWindow)
mainWindow.webContents.on('context-menu', () => {

View File

@ -51,11 +51,6 @@ const Sidebar: FC = () => {
<i className="iconfont icon-chat"></i>
</Icon>
</StyledLink>
<StyledLink onClick={() => to('/files')}>
<Icon className={isRoute('/files')}>
<FolderOutlined />
</Icon>
</StyledLink>
<StyledLink onClick={() => to('/agents')}>
<Icon className={isRoute('/agents')}>
<i className="iconfont icon-business-smart-assistant"></i>
@ -71,6 +66,11 @@ const Sidebar: FC = () => {
<i className="iconfont icon-appstore"></i>
</Icon>
</StyledLink>
<StyledLink onClick={() => to('/files')}>
<Icon className={isRoute('/files')}>
<FolderOutlined />
</Icon>
</StyledLink>
</Menus>
</MainMenus>
<Menus>

View File

@ -41,8 +41,8 @@ class FileManager {
return
}
await window.api.file.delete(id + file.ext)
db.files.delete(id)
await window.api.file.delete(id + file.ext)
}
static async deleteFiles(ids: string[]): Promise<void> {