|
@@ -36,6 +36,7 @@ import update_username_in_gui from './helpers/update_username_in_gui.js';
|
|
|
import update_title_based_on_uploads from './helpers/update_title_based_on_uploads.js';
|
|
|
import content_type_to_icon from './helpers/content_type_to_icon.js';
|
|
|
import UIWindowDownloadDirProg from './UI/UIWindowDownloadDirProg.js';
|
|
|
+import { PortalProcess } from "./definitions.js";
|
|
|
|
|
|
window.is_auth = ()=>{
|
|
|
if(localStorage.getItem("auth_token") === null || auth_token === null)
|
|
@@ -1675,6 +1676,24 @@ window.launch_app = async (options)=>{
|
|
|
// add file_signature to options
|
|
|
file_signature = file_signature.items;
|
|
|
}
|
|
|
+
|
|
|
+ // -----------------------------------
|
|
|
+ // Create entry to track the "portal"
|
|
|
+ // (portals are processese in Puter's GUI)
|
|
|
+ // -----------------------------------
|
|
|
+ const portal = new PortalProcess({
|
|
|
+ uuid,
|
|
|
+ parent: options.parent_instance_id,
|
|
|
+ meta: {
|
|
|
+ launch_options: options,
|
|
|
+ app_info: app_info,
|
|
|
+ }
|
|
|
+ });
|
|
|
+ const svc_process = globalThis.services.get('process');
|
|
|
+ svc_process.register(portal);
|
|
|
+
|
|
|
+ let el_win;
|
|
|
+
|
|
|
//------------------------------------
|
|
|
// Explorer
|
|
|
//------------------------------------
|
|
@@ -1692,7 +1711,7 @@ window.launch_app = async (options)=>{
|
|
|
title = path.dirname(options.path);
|
|
|
|
|
|
// open window
|
|
|
- UIWindow({
|
|
|
+ el_win = UIWindow({
|
|
|
element_uuid: uuid,
|
|
|
icon: icon,
|
|
|
path: options.path ?? window.home_path,
|
|
@@ -1803,7 +1822,7 @@ window.launch_app = async (options)=>{
|
|
|
|
|
|
console.log('backgrounded??', app_info.background);
|
|
|
|
|
|
- const el_win = UIWindow({
|
|
|
+ el_win = UIWindow({
|
|
|
element_uuid: uuid,
|
|
|
title: title,
|
|
|
iframe_url: iframe_url.href,
|
|
@@ -1854,6 +1873,10 @@ window.launch_app = async (options)=>{
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ $(el_win).on('remove', () => {
|
|
|
+ svc_process.unregister(portal.uuid);
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
window.open_item = async function(options){
|