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

Fixes broken UI issue #3074

Merged
merged 1 commit into from
Aug 15, 2024
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
5 changes: 5 additions & 0 deletions .changeset/silly-beds-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tokens-studio/figma-plugin": patch
---

Fixed an issue with UI appearing broken, related to the debug session recording feature
18 changes: 12 additions & 6 deletions packages/tokens-studio-for-figma/src/app/sentry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,20 @@ export const replay = new Sentry.Replay({
});

export const setupReplay = () => {
const client = Sentry.getCurrentHub().getClient();
setTimeout(() => {
try {
const client = Sentry.getCurrentHub().getClient();

if (client) {
if (!client?.getIntegration(Sentry.Replay)) {
// @ts-ignore This should never be undefined after the check above
client.addIntegration(replay);
if (client) {
if (!client?.getIntegration(Sentry.Replay)) {
// @ts-ignore This should never be undefined after the check above
client.addIntegration(new Replay());
}
}
} catch (error) {
console.error('Error setting up Sentry Replay:', error);
}
}
}, 2000); // Delay by 2000 milliseconds (2 seconds) to make sure we load in UI properly, see https://github.com/tokens-studio/figma-plugin/issues/3073
};

export const initializeSentry = () => {
Expand Down
Loading