Skip to content

Commit

Permalink
More sentry errors (#654)
Browse files Browse the repository at this point in the history
* Always set complete to false when selecting new project

* Protect againt `undefined.tier_1_reviewer`
  • Loading branch information
annehaley authored May 4, 2023
1 parent d194e2d commit 2cdaaf1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 3 additions & 2 deletions web_client/src/components/ProjectUsers.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ export default defineComponent({
const collaborators = computed(
() => currentProject.value.settings.permissions.collaborator as User[],
);
const members = computed(() => [
const members = computed(() => (currentProject.value?.settings?.permissions ? [
...currentProject.value.settings.permissions.tier_1_reviewer,
...currentProject.value.settings.permissions.tier_2_reviewer,
] as User[]);
] as User[] : []));
const emailOptions = computed(() => members.value.concat(collaborators.value).map(
(u: User) => u.email,
));
Expand Down Expand Up @@ -285,6 +285,7 @@ export default defineComponent({
:dark="false"
>
<v-card
v-if="selectedPermissionSet"
class="dialog-box"
>
<v-btn
Expand Down
8 changes: 3 additions & 5 deletions web_client/src/views/Projects.vue
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,7 @@ export default defineComponent({
}
}
function selectProject(project: Project) {
if (complete) {
complete = false;
}
complete = false;
store.dispatch('loadProject', project);
}
async function createProject() {
Expand Down Expand Up @@ -152,7 +150,7 @@ export default defineComponent({
while (
(!nextScan
|| (nextScanState === 'complete' && reviewMode.value))
&& nextProject.experiments[0].scans
&& nextProject.experiments[0]?.scans
&& nextScanIndex < nextProject.experiments[0].scans.length
) {
nextScan = nextProject.experiments[0].scans[nextScanIndex];
Expand Down Expand Up @@ -372,7 +370,7 @@ export default defineComponent({
fill-height
>
<div
v-if="complete"
v-if="complete && currentProject"
class="text-h6 text-center"
>
Viewed all scans in Project {{ currentProject.name }}.
Expand Down

0 comments on commit 2cdaaf1

Please sign in to comment.