Skip to content

Commit

Permalink
Merge pull request #121 from nkolba/fix-directory-load-timing
Browse files Browse the repository at this point in the history
Fix directory load timing
  • Loading branch information
nkolba authored Dec 6, 2022
2 parents 30ab623 + 21b614a commit 828020a
Show file tree
Hide file tree
Showing 3 changed files with 147 additions and 5 deletions.
141 changes: 141 additions & 0 deletions directory/demo.v2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
{
"applications": [


{
"appId": "sailDemo1",
"name": "sailDemo1",
"title": "Sail Demo - Step 1",
"description": "Demo of app building in Sail",
"icons": [
{
"src": "https://raw.githubusercontent.com/finos/FDC3-Sail/main/images/logo_bg_white_2x.png"
}
],
"screenshots": [],
"type": "web",
"details": {
"url": "https://apps.connectifi-interop.com/sail/contactsDemo/step1.html"
},
"interop": {
"intents": {
"listensFor": {
"ViewContact": {
"displayName": "View Contact",
"contexts": [
"fdc3.contact"
]
}
}
}
},
"hostManifests": {
"sail": {
"injectApi": "1.2"
}
}
},

{
"appId": "sailDemo2",
"name": "sailDemo2",
"title": "Sail Demo - Step 2",
"description": "Demo of app building in Sail",
"icons": [
{
"src": "https://raw.githubusercontent.com/finos/FDC3-Sail/main/images/logo_bg_white_2x.png"
}
],
"screenshots": [],
"type": "web",
"details": {
"url": "https://apps.connectifi-interop.com/sail/contactsDemo/step2.html"
},
"interop": {
"intents": {
"listensFor": {
"ViewContact": {
"displayName": "View Contact",
"contexts": [
"fdc3.contact"
]
}
}
}
},
"hostManifests": {
"sail": {
"injectApi": "1.2"
}
}
},
{
"appId": "sailDemo3",
"name": "sailDemo3",
"title": "Sail Demo - Step 3",
"description": "Demo of app building in Sail",
"icons": [
{
"src": "https://raw.githubusercontent.com/finos/FDC3-Sail/main/images/logo_bg_white_2x.png"
}
],
"screenshots": [],
"type": "web",
"details": {
"url": "https://apps.connectifi-interop.com/sail/contactsDemo/step3.html"
},
"interop": {
"intents": {
"listensFor": {
"ViewContact": {
"displayName": "View Contact",
"contexts": [
"fdc3.contact"
]
}
}
}
},
"hostManifests": {
"sail": {
"injectApi": "1.2"
}
}
},
{
"appId": "sailDemo1",
"name": "sailDemo1",
"title": "Sail Demo - Step 4",
"description": "Demo of app building in Sail - in FDC3 2.0",
"icons": [
{
"src": "https://raw.githubusercontent.com/finos/FDC3-Sail/main/images/logo_bg_white_2x.png"
}
],
"screenshots": [],
"type": "web",
"details": {
"url": "https://apps.connectifi-interop.com/sail/contactsDemo/step4.html"
},
"interop": {
"intents": {
"listensFor": {
"ViewContact": {
"displayName": "View Contact",
"contexts": [
"fdc3.contact"
]
}
}
}
},
"hostManifests": {
"sail": {
"injectApi": "2.0"
}
}
}

],
"message": "OK"
}
2 changes: 1 addition & 1 deletion packages/main/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ app
.then(async () => {
console.log('index - create runtime');
runtime = new Runtime();
runtime.startup();
await runtime.startup();
console.log('index - createWindow');
await createWindow();
console.log('index - window created');
Expand Down
9 changes: 5 additions & 4 deletions packages/main/src/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class Runtime {

//listener: RuntimeListener;

startup() {
async startup() {
//clear all previous Handlers
ipcMain.removeAllListeners();

Expand All @@ -76,16 +76,17 @@ export class Runtime {
// contextListeners.set(chan.id, new Map());
contexts.set(chan.id, []);
});
this.initDirectory();
await this.initDirectory();
return;
}

initDirectory() {
async initDirectory() {
const urls = utils.getDirectoryUrl().split(',');
this.directory = new Directory(urls, [
fdc3_2_0_AppDirectoryLoader,
fdc3_1_2_AppDirectoryLoader,
]);
this.directory.reload();
await this.directory.reload();
}

getDirectory(): Directory {
Expand Down

0 comments on commit 828020a

Please sign in to comment.