Fix issue with trash not opening from taskbar

This commit is contained in:
Nariman Jelveh 2024-05-03 19:57:48 -07:00
parent 33a6f4c49f
commit ecd9d5493f
2 changed files with 20 additions and 5 deletions

View File

@ -113,15 +113,15 @@ function UITaskbarItem(options){
// -------------------------------------------
if(menu_items.length > 0)
menu_items.push('-');
//------------------------------------------
// New Window
//------------------------------------------
if(options.app){
if(options.app && options.app !== 'trash'){
menu_items.push({
html: 'New Window',
val: $(this).attr('data-id'),
onClick: function(){
// is trash?
window.launch_app({
name: options.app,
maximized: (isMobile.phone || isMobile.tablet),
@ -130,6 +130,22 @@ function UITaskbarItem(options){
})
}
//------------------------------------------
// Open Trash
//------------------------------------------
else if(options.app && options.app === 'trash'){
menu_items.push({
html: 'Open Trash',
val: $(this).attr('data-id'),
onClick: function(){
window.launch_app({
name: options.app,
path: window.trash_path,
maximized: (isMobile.phone || isMobile.tablet),
})
}
})
}
//------------------------------------------
// Empty Trash
//------------------------------------------
if(options.app === 'trash' && options.name === 'Trash'){
@ -145,7 +161,6 @@ function UITaskbarItem(options){
}
})
}
//------------------------------------------
// Remove from Taskbar
//------------------------------------------

View File

@ -1534,7 +1534,6 @@ window.move_clipboard_items = function (el_target_container, target_path){
* let filePaths = ['/path/to/file1.txt', '/path/to/file2.png'];
* window.trigger_download(filePaths);
*/
window.trigger_download = (paths)=>{
let urls = [];
for (let index = 0; index < paths.length; index++) {
@ -1619,7 +1618,7 @@ window.launch_app = async (options)=>{
//------------------------------------
// Explorer
//------------------------------------
if(options.name === 'explorer'){
if(options.name === 'explorer' || options.name === 'trash'){
process = new PseudoProcess({
uuid,
name: 'explorer',
@ -1637,6 +1636,7 @@ window.launch_app = async (options)=>{
}
else if(options.path === window.trash_path){
title = 'Trash';
icon = window.icons['trash.svg'];
}
else if(!options.path)
title = window.root_dirname;