Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Miscellaneous fixes #502

Merged
merged 3 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/components/MessageItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,11 @@ export default defineComponent({
flex-flow: row;
justify-content: space-between;
align-items: center;
user-select: text;
}

.details {
white-space: break-spaces;
user-select: text;
}
</style>
6 changes: 5 additions & 1 deletion src/composables/useGlobalErrorHook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ export function useGlobalErrorHook() {
const messageStore = useMessageStore();

const onError = (event: ErrorEvent) => {
messageStore.addError('Application error (click for details)', event.error);
console.error(event);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good! Thinking we should send more errors to Sentry via:
Sentry.captureException https://docs.sentry.io/platforms/javascript/usage/

or

Sentry.init({
  dsn: 'https://your-sentry-server-dsn',
  integrations: [
    new CaptureConsole({
      levels: ['error']
    })
  ],
...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this idea! I'll cover this in a later PR.

const details = event.error
? event.error
: { details: event.message ?? 'Unknown error' };
messageStore.addError('Application error (click for details)', details);
};

onMounted(() => {
Expand Down
7 changes: 2 additions & 5 deletions src/composables/useResizeObserver.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { onBeforeUnmount, Ref, unref, watch } from 'vue';
import { onBeforeUnmount, Ref, watch } from 'vue';

/**
* Invokes a callback whenever an element is resized.
Expand Down Expand Up @@ -27,10 +27,7 @@ export function useResizeObserver(
);

onBeforeUnmount(() => {
const targetEl = unref(targetElRef);
if (targetEl) {
observer.unobserve(targetEl);
}
observer.disconnect();
});

return observer;
Expand Down
Loading