mirror of
https://github.com/marktext/marktext.git
synced 2025-05-02 19:41:39 +08:00
parent
9c0238d7bb
commit
b75895cdd1
@ -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'
|
||||
@ -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)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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',
|
||||
|
Loading…
Reference in New Issue
Block a user