Skip to content

Commit

Permalink
Fix: Move to trash not working in Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ollm authored Feb 3, 2025
1 parent 7a9583e commit 8c34a31
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

- Error saving images with dialog [`f2445de`](https://github.com/ollm/OpenComic/commit/f2445de4af8e515fe9dda2ed7dc71e3213922b8e)
- Drag and Drop not working due an Electron breaking change [`a830bf8`](https://github.com/ollm/OpenComic/commit/a830bf8a11f62eb9daeafcf56fd59e0489ce42d0)
- Move to trash not working in Windows

## [v1.4.0](https://github.com/ollm/OpenComic/releases/tag/v1.4.0) (26-01-2025)

Expand Down
2 changes: 1 addition & 1 deletion scripts/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -2296,7 +2296,7 @@ function removeComic(path, confirm = false, reload = true)
async function moveToTrash(path, fromIndexNotMasterFolders = false, confirm = false)
{
await dom.poster.findAndDelete(path, true, true);
await electron.shell.trashItem(path);
await electron.ipcRenderer.invoke('move-to-trash', path);

if(fromIndexNotMasterFolders)
dom.removeComic(path, true, false);
Expand Down
10 changes: 8 additions & 2 deletions scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function createWindow() {

let windowShowed = false;

let showTimeout = setTimeout(function(){
let showTimeout = setTimeout(function() {

win.show();
windowShowed = true;
Expand Down Expand Up @@ -201,14 +201,20 @@ app.on('activate', () => {
}
})

ipcMain.on('open-at-login', function(event, active = false){
ipcMain.on('open-at-login', function(event, active = false) {

app.setLoginItemSettings({
openAtLogin: active,
})

});

ipcMain.handle('move-to-trash', function(event, path) {

return shell.trashItem(path);

});

// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.

Expand Down

0 comments on commit 8c34a31

Please sign in to comment.