Skip to content

Commit

Permalink
fix: Change logic to detect correct skipped page for permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobiClark committed Dec 19, 2024
1 parent 5eb2405 commit a363400
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/renderer/src/scripts/guided-mode/guided-curate-dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -15634,22 +15634,19 @@ const guidedPennsieveDatasetUpload = async () => {
await guidedAddDatasetLicense(guidedBfAccount, guidedDatasetName, guidedLicense);
await guidedAddDatasetTags(guidedBfAccount, guidedDatasetName, guidedTags);
if (!pageIsSkipped("guided-designate-permissions-tab")) {
// Reconfirm that the user is not a guest before adding permissions

let guest = false;

try {
guest = await window.isWorkspaceGuest();
// Double check if the user is a guest before adding permissions
const guest = await window.isWorkspaceGuest();

if (!guest) {
await guidedAddUserPermissions(guidedBfAccount, guidedDatasetName, guidedUsers);
await guidedAddTeamPermissions(guidedBfAccount, guidedDatasetName, guidedTeams);
}
} catch (error) {
const errorMessage = userErrorMessage(error);
log.error("Error checking if user is a guest during dataset upload", errorMessage);
log.error("Error checking guest status during dataset upload", errorMessage);
throw new Error(errorMessage);
}

if (!guest) {
await guidedAddUserPermissions(guidedBfAccount, guidedDatasetName, guidedUsers);
await guidedAddTeamPermissions(guidedBfAccount, guidedDatasetName, guidedTeams);
}
}
}

Expand Down

0 comments on commit a363400

Please sign in to comment.