Skip to content

Commit

Permalink
updates for fasten-desktop.
Browse files Browse the repository at this point in the history
Unfortunately the /wails/runtime.js request is expected to fail in Docker, but will work in desktop env. Working on a better solution.
  • Loading branch information
AnalogJ committed Jun 14, 2024
1 parent 1485329 commit ea8a996
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions frontend/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@

<!-- required for lhncbc/lforms -->
<script src="./assets/js/webcomponents/webcomponents-loader.js"></script>

<!-- wails -- this file is expected to be missing in docker/web mode. It's only required in Desktop -->
<script type="module" src="/wails/runtime.js"></script>

<script>
if (!window.customElements) {
document.write('<!--');
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/utils/external_link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export function OpenExternalLink(url: string, desktopMode: boolean, windowId?: s

//check if wails exists and is defined
if(typeof wails !== "undefined" && desktopMode){
wails.CallByName("pkg.AppService.BrowserOpenURL", url, windowId || 'external')
wails.Call.ByName("github.com/fastenhealth/fasten-desktop/pkg.AppService.BrowserOpenURL", url, windowId || 'external').then(console.log, console.error)
} else{
window.open(url, "_blank");
}
Expand Down
7 changes: 4 additions & 3 deletions frontend/src/polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@ declare global {
Once: (eventName, callback) => void
On: (eventName, callback) => void
}
Call: (options) => Promise<any>
CallByID: (methodID, ...args) => Promise<any>
CallByName: (name, ...args) => Promise<any>
Call: {
ByID: (methodID, ...args) => Promise<any>
ByName: (name, ...args) => Promise<any>
}
}

//see https://lhncbc.github.io/lforms/ for definitions
Expand Down

0 comments on commit ea8a996

Please # to comment.