Skip to content

Commit

Permalink
Don't prompt to open current project. Fix #1385
Browse files Browse the repository at this point in the history
  • Loading branch information
brollb committed Jul 14, 2023
1 parent d077c17 commit 56d73e9
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/gui-ext.js
Original file line number Diff line number Diff line change
Expand Up @@ -639,16 +639,20 @@ IDE_Morph.prototype.respondToCollaborateRequest = async function (request) {
this,
async () => {
await this.cloud.respondToCollaborateRequest(request.id, true);
const dialog = new DialogBoxMorph();
dialog.askYesNo(
localize('Open Shared Project?'),
localize('Would you like to open the shared project now?'),
this.root(),
);
dialog.ok = async () => {
const source = new SharedCloudProjectsSource(this);
await source.open(metadata);
};
const isOccupied = request.projectId === this.cloud.projectId;

if (!isOccupied) {
const dialog = new DialogBoxMorph();
dialog.askYesNo(
localize('Open Shared Project?'),
localize('Would you like to open the shared project now?'),
this.root(),
);
dialog.ok = async () => {
const source = new SharedCloudProjectsSource(this);
await source.open(metadata);
};
}
},
);
dialog.labelString = 'Respond to Collaborate Request';
Expand Down

0 comments on commit 56d73e9

Please sign in to comment.