diff --git a/src/app/components/app-shell/AppShell.tsx b/src/app/components/app-shell/AppShell.tsx index eb2dd3101..c69500ba4 100644 --- a/src/app/components/app-shell/AppShell.tsx +++ b/src/app/components/app-shell/AppShell.tsx @@ -21,6 +21,7 @@ import { ScreenSizeProvider } from '$hooks/useScreenSize'; import { isReactQueryDevtoolsEnabled } from '$pages/reactQueryDevtoolsGate'; import { useDesktopSetting } from '$state/hooks/desktopSettings'; import { getCustomTitlebarKind } from '$utils/tauriTitlebar'; +import { getCspNonce } from '$utils/cspNonce'; import { SystemBarShell } from './SystemBarShell'; const ReactQueryDevtools = lazy(async () => { @@ -57,7 +58,10 @@ export function AppShell({ children, queryClient, screenSize, jotaiStore }: AppS {reactQueryDevtoolsEnabled && ( - + )} diff --git a/src/app/pages/App.tsx b/src/app/pages/App.tsx index 58e865900..3f7ccbfd0 100644 --- a/src/app/pages/App.tsx +++ b/src/app/pages/App.tsx @@ -19,6 +19,7 @@ import { isReactQueryDevtoolsEnabled } from './reactQueryDevtoolsGate'; import { bootstrapSettingsStore } from '$state/settings'; import { AppShell } from '$components/app-shell'; import { normalizeOAuthCallbackUrl } from '$utils/oauthCallback'; +import { getCspNonce } from '$utils/cspNonce'; const queryClient = new QueryClient({ defaultOptions: { @@ -53,7 +54,7 @@ function BootstrappedAppShell({ clientConfig, screenSize, jotaiStore }: Bootstra {reactQueryDevtoolsEnabled && ( - + )} diff --git a/src/index.tsx b/src/index.tsx index ded943743..2d4f2e6b5 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -10,8 +10,10 @@ import '@fontsource/space-mono/700-italic.css'; import 'katex/dist/katex.min.css'; import 'folds/dist/style.css'; import { configClass, varsClass } from 'folds'; +import { setNonce as setReactColorfulNonce } from 'react-colorful'; import App from './app/pages/App'; import './app/i18n'; +import { getCspNonce } from './app/utils/cspNonce'; import './index.css'; import './app/styles/themes.css'; @@ -30,6 +32,8 @@ import { installTauriNativeBehaviors } from './app/utils/tauriNative'; import { installAndroidBackBridge } from './app/utils/androidBack'; enableMapSet(); +const tauriStyleNonce = getCspNonce(); +if (tauriStyleNonce) setReactColorfulNonce(tauriStyleNonce); installConsolePasteScamWarning(); registerMatrixUriProtocol(); const log = createLogger('index');