Skip to content

Commit

Permalink
fix #3150: Win32 error in renderer process (#3214)
Browse files Browse the repository at this point in the history
  • Loading branch information
fxha committed Aug 8, 2023
1 parent 9c0238d commit b75895c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/main/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import fsPromises from 'fs/promises'
import { exec } from 'child_process'
import dayjs from 'dayjs'
import log from 'electron-log'
import { app, BrowserWindow, clipboard, dialog, ipcMain, nativeTheme } from 'electron'
import { app, BrowserWindow, clipboard, dialog, ipcMain, nativeTheme, shell } from 'electron'
import { isChildOfDirectory } from 'common/filesystem/paths'
import { isLinux, isOsx, isWindows } from '../config'
import parseArgs from '../cli/parser'
Expand Down Expand Up @@ -576,6 +576,10 @@ class App {
const { keybindings } = this._accessor
return keybindings.setUserKeybindings(userKeybindings)
})

ipcMain.handle('mt::fs-trash-item', async (event, fullPath) => {
return shell.trashItem(fullPath)
})
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/store/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ const actions = {
})
bus.$on('SIDEBAR::remove', () => {
const { pathname } = state.activeItem
shell.trashItem(pathname).catch(err => {
ipcRenderer.invoke('mt::fs-trash-item', pathname).catch(err => {
notice.notify({
title: 'Error while deleting',
type: 'error',
Expand Down

0 comments on commit b75895c

Please sign in to comment.