Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
@@ -0,0 +1,36 @@
|
||||
import * as Sentry from "@sentry/react-router";
|
||||
|
||||
export type SentryReplayConfig = {
|
||||
replaysSessionSampleRate: number;
|
||||
replaysOnErrorSampleRate: number;
|
||||
};
|
||||
|
||||
export function enableSentryReplay(config: SentryReplayConfig): boolean {
|
||||
if (!Sentry.isInitialized() || (config.replaysSessionSampleRate <= 0 && config.replaysOnErrorSampleRate <= 0)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const existing = Sentry.getReplay();
|
||||
if (existing) {
|
||||
existing.start();
|
||||
return true;
|
||||
}
|
||||
|
||||
Sentry.addIntegration(
|
||||
Sentry.replayIntegration({
|
||||
blockAllMedia: true,
|
||||
maskAllInputs: true,
|
||||
maskAllText: true,
|
||||
}),
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
export async function disableSentryReplay(): Promise<boolean> {
|
||||
const replay = Sentry.getReplay();
|
||||
if (!replay) {
|
||||
return false;
|
||||
}
|
||||
await replay.stop();
|
||||
return true;
|
||||
}
|
||||
Reference in new issue
Block a user