fixing desktop app issues

related #384
This commit is contained in:
Jason Kulatunga 2024-01-17 21:15:54 -08:00
parent 57cd4c3f0c
commit d08a3e8501
No known key found for this signature in database
2 changed files with 10 additions and 3 deletions

View File

@ -190,7 +190,9 @@ export class MedicalSourcesConnectedComponent implements OnInit {
// this.connectedSourceList.
//find the index of the "inprogress" source in the connected List, and then add this source to its source metadata.
let foundSource = this.connectedSourceList.findIndex((item) => item.brand.id == dbSourceCredential.brand_id)
let foundSource = this.connectedSourceList.findIndex((item) => {
return item.source?.brand_id == dbSourceCredential.brand_id || item.brand?.id == dbSourceCredential.brand_id
})
this.connectedSourceList[foundSource].source = resp.source
console.log("source sync-all response:", resp.summary)
@ -402,6 +404,7 @@ export class MedicalSourcesConnectedComponent implements OnInit {
if(!desktopRedirectData){
return //wait for redirect
}
//Note: this code will only run in Desktop mode (with popups)
//in non-desktop environments, the user is redirected in the same window, and this code is never executed.

View File

@ -292,7 +292,11 @@ export class MedicalSourcesComponent implements OnInit {
console.log('authorize url:', authorizationUrl.toString());
// redirect to lighthouse with uri's (or open a new window in desktop mode)
this.lighthouseApi.redirectWithOriginAndDestination(authorizationUrl.toString(), sourceMetadata).subscribe((codeData) => {
this.lighthouseApi.redirectWithOriginAndDestination(authorizationUrl.toString(), sourceMetadata).subscribe((desktopRedirectData) => {
if(!desktopRedirectData){
return //wait for redirect
}
//Note: this code will only run in Desktop mode (with popups)
//in non-desktop environments, the user is redirected in the same window, and this code is never executed.
@ -300,7 +304,7 @@ export class MedicalSourcesComponent implements OnInit {
this.modalService.dismissAll()
//redirect the browser back to this page with the code in the query string parameters
this.lighthouseApi.redirectWithDesktopCode(sourceMetadata.platform_type, codeData)
this.lighthouseApi.redirectWithDesktopCode(desktopRedirectData.state, desktopRedirectData.codeData)
})
});
}