mirror of
https://github.com/HeyPuter/puter
synced 2024-11-14 22:06:00 +00:00
Fix issue with trash not opening from taskbar
This commit is contained in:
parent
33a6f4c49f
commit
ecd9d5493f
@ -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
|
||||
//------------------------------------------
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user