Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Start tackling strict null

Manav Rathi431d62964163
diff --git a/web/apps/auth/tsconfig.json b/web/apps/auth/tsconfig.json
index 880d547c49..2ee2af539c 100644
--- a/web/apps/auth/tsconfig.json
+++ b/web/apps/auth/tsconfig.json
@@ -14,7 +14,7 @@
"jsxImportSource": "@emotion/react",
"strict": true,
- "strictNullChecks": false,
+ "strictNullChecks": true,
/* Stricter than strict */
"noImplicitReturns": true,
"noUnusedParameters": true,
diff --git a/web/packages/shared/themes/palette/index.tsx b/web/packages/shared/themes/palette/index.tsx
index d53a958b8e..14d33eb748 100644
--- a/web/packages/shared/themes/palette/index.tsx
+++ b/web/packages/shared/themes/palette/index.tsx
@@ -1,5 +1,6 @@
import type { PaletteOptions, ThemeColorsOptions } from "@mui/material";
import { THEME_COLOR } from "../constants";
+import { ensure } from "@/utils/ensure";
export const getPallette = (
themeColor: THEME_COLOR,
@@ -20,38 +21,39 @@ export const getPalletteOptions = (
): PaletteOptions => {
return {
primary: {
- main: colors.fill.base,
- dark: colors.fill.basePressed,
+ // TODO: Refactor this code to not require this ensure
+ main: ensure(colors.fill?.base),
+ dark: colors.fill?.basePressed,
contrastText:
- themeColor === "dark" ? colors.black.base : colors.white.base,
+ themeColor === "dark" ? colors.black?.base : colors.white?.base,
},
secondary: {
- main: colors.fill.faint,
- dark: colors.fill.faintPressed,
- contrastText: colors.text.base,
+ main: ensure(colors.fill?.faint),
+ dark: colors.fill?.faintPressed,
+ contrastText: colors.text?.base,
},
accent: {
- main: colors.accent.A500,
- dark: colors.accent.A700,
- contrastText: colors.white.base,
+ main: ensure(colors.accent?.A500),
+ dark: colors.accent?.A700,
+ contrastText: colors.white?.base,
},
critical: {
- main: colors.danger.A700,
- dark: colors.danger.A800,
- contrastText: colors.white.base,
+ main: ensure(colors.danger?.A700),
+ dark: colors.danger?.A800,
+ contrastText: colors.white?.base,
},
background: {
- default: colors.background.base,
- paper: colors.background.elevated,
+ default: colors.background?.base,
+ paper: colors.background?.elevated,
},
text: {
- primary: colors.text.base,
- secondary: colors.text.muted,
- disabled: colors.text.faint,
- base: colors.text.base,
- muted: colors.text.muted,
- faint: colors.text.faint,
+ primary: colors.text?.base,
+ secondary: colors.text?.muted,
+ disabled: colors.text?.faint,
+ base: colors.text?.base,
+ muted: colors.text?.muted,
+ faint: colors.text?.faint,
},
- divider: colors.stroke.faint,
+ divider: colors.stroke?.faint,
};
};