Skip to content

Commit

Permalink
Merge pull request #1429 from ssiyad/fix/ui/handle_invalid_assign_json
Browse files Browse the repository at this point in the history
fix(ui): handle invalid `_assign` json
  • Loading branch information
ssiyad authored Aug 2, 2023
2 parents 62a6067 + aa05ef6 commit 692ce8e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion desk/src/pages/desk/ticket-list/AssignedInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ const props = withDefaults(defineProps<P>(), {
});
const assign = toRef(props, "assign");
const assignJson = computed(() => JSON.parse(assign.value));
const assignJson = computed(() => {
const parsed = JSON.parse(assign.value);
const arr = Array.isArray(parsed) ? parsed : [];
return arr;
});
const agent = computed(() => [...assignJson.value].pop());
const user = computed(() => userStore.getUser(agent.value));
const userImage = computed(() => user.value?.user_image);
Expand Down

0 comments on commit 692ce8e

Please sign in to comment.