diff --git a/js/index.js b/js/index.js index eb6c5cef..aaa050ad 100644 --- a/js/index.js +++ b/js/index.js @@ -14,6 +14,7 @@ import internetArchive from "../skins/Internet-Archive.wsz"; import MilkdropWindow from "./components/MilkdropWindow"; import screenshotInitialState from "./screenshotInitialState"; import { WINDOWS } from "./constants"; +import * as Selectors from "./selectors"; import WebampLazy from "./webampLazy"; import enableMediaSession from "./mediaSession"; @@ -135,16 +136,7 @@ Raven.config(SENTRY_DSN, { const ravenMiddleware = createMiddleware(Raven, { filterBreadcrumbActions, - stateTransformer: state => ({ - ...state, - display: { - ...state.display, - skinGenLetterWidths: "[[REDACTED]]", - skinImages: "[[REDACTED]]", - skinCursors: "[[REDACTED]]", - skinRegion: "[[REDACTED]]" - } - }) + stateTransformer: Selectors.getDebugData }); // Don't prompt user to install Webamp. It's probably not diff --git a/js/selectors.ts b/js/selectors.ts index 8711f3c0..c401df53 100644 --- a/js/selectors.ts +++ b/js/selectors.ts @@ -538,3 +538,16 @@ export const getMarqueeText = (state: AppState): string => { } return defaultText; }; + +export function getDebugData(state: AppState) { + return { + ...state, + display: { + ...state.display, + skinGenLetterWidths: "[[REDACTED]]", + skinImages: "[[REDACTED]]", + skinCursors: "[[REDACTED]]", + skinRegion: "[[REDACTED]]" + } + }; +}