Skip to content

Commit

Permalink
[loading] ensure desktop notified at popup loading error
Browse files Browse the repository at this point in the history
  • Loading branch information
nxmatic committed Jul 10, 2024
1 parent ab57b5e commit 8625b40
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/server-connector.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,18 +233,18 @@ class ServerConnector extends ServiceWorkerComponent {
asNuxeo() {
return this.worker
.tabNavigationHandler.asTabInfo()
.then((tabInfo) => this.nuxeoUrlOf(tabInfo.url))
.then((nuxeoUrl) => {
if (nuxeoUrl === undefined) {
return undefined;
.then((tabInfo) => {
const serverUrl = this.nuxeoUrlOf(tabInfo.url);
if (serverUrl === undefined) {
throw new Error(`${tabInfo.url} not handled has a nuxeo URL, are you on the correct tab ?`);
}
if (this.nuxeo && this.nuxeo._baseURL === nuxeoUrl.toString()) {
if (this.nuxeo && this.nuxeo._baseURL === serverUrl.toString()) {
return this.nuxeo;
}
return this.connect(serverUrl, tabInfo)
.then(() => {
if (this.nuxeo === undefined) {
throw Error('Not connected to Nuxeo');
throw new Error(`Cannot connect to ${serverUrl}`);
}
return this.nuxeo;
})
Expand Down

0 comments on commit 8625b40

Please sign in to comment.