- {[
+ {([
["username", user.username,
],
["email", email,
],
["password", "*****",
]
- ].map(([field, value, icon]) => (
+ ] as const).map(([field, value, icon]) => (
{icon}
@@ -71,7 +71,7 @@ export function Account() {
onClick={() =>
openScreen({
id: "modify_account",
- field: field as any
+ field: field
})
}
contrast
diff --git a/src/pages/settings/panes/Appearance.tsx b/src/pages/settings/panes/Appearance.tsx
index b0ed1dae..fdf209d1 100644
--- a/src/pages/settings/panes/Appearance.tsx
+++ b/src/pages/settings/panes/Appearance.tsx
@@ -208,7 +208,7 @@ export function Component(props: Props & WithDispatcher) {
- {[
+ {([
"accent",
"background",
"foreground",
@@ -234,15 +234,15 @@ export function Component(props: Props & WithDispatcher) {
"warning",
"error",
"hover"
- ].map(x => (
+ ] as const).map(x => (
{x}
+ style={{ backgroundColor: theme[x] }}>
setOverride({
[x]: v.currentTarget.value
@@ -252,7 +252,7 @@ export function Component(props: Props & WithDispatcher) {
setOverride({
[x]: y.currentTarget.value
diff --git a/src/pages/settings/panes/Notifications.tsx b/src/pages/settings/panes/Notifications.tsx
index 1dca0cd6..6122d284 100644
--- a/src/pages/settings/panes/Notifications.tsx
+++ b/src/pages/settings/panes/Notifications.tsx
@@ -78,11 +78,11 @@ export function Component({ options, dispatcher }: Props & WithDispatcher) {
// tell the server we just subscribed
const json = sub.toJSON();
- if (json.keys) {
+ if (json.keys) {;
client.req("POST", "/push/subscribe", {
endpoint: sub.endpoint,
- ...json.keys
- } as any);
+ ...(json.keys as { p256dh: string, auth: string })
+ });
setPushEnabled(true);
}
} else {
diff --git a/src/pages/settings/panes/Profile.tsx b/src/pages/settings/panes/Profile.tsx
index 941d311d..1b6fa429 100644
--- a/src/pages/settings/panes/Profile.tsx
+++ b/src/pages/settings/panes/Profile.tsx
@@ -11,7 +11,7 @@ import { ClientStatus, StatusContext } from "../../../context/revoltjs/RevoltCli
import AutoComplete, { useAutoComplete } from "../../../components/common/AutoComplete";
export function Profile() {
- const { intl } = useContext(IntlContext) as any;
+ const { intl } = useContext(IntlContext);
const status = useContext(StatusContext);
const ctx = useForceUpdate();
@@ -121,7 +121,7 @@ export function Profile() {
: "placeholder"
}`,
"",
- intl.dictionary
+ (intl as any).dictionary as Record
)}
onKeyUp={onKeyUp}
onKeyDown={onKeyDown}
diff --git a/src/pages/settings/panes/Sessions.tsx b/src/pages/settings/panes/Sessions.tsx
index b9bccc4b..2ec357be 100644
--- a/src/pages/settings/panes/Sessions.tsx
+++ b/src/pages/settings/panes/Sessions.tsx
@@ -155,7 +155,7 @@ export function Sessions() {
]);
await client.req(
"DELETE",
- `/auth/sessions/${session.id}` as any
+ `/auth/sessions/${session.id}` as '/auth/sessions'
);
setSessions(
sessions?.filter(
diff --git a/src/pages/settings/server/Roles.tsx b/src/pages/settings/server/Roles.tsx
index db3887c3..cd827fe3 100644
--- a/src/pages/settings/server/Roles.tsx
+++ b/src/pages/settings/server/Roles.tsx
@@ -30,7 +30,7 @@ export function Roles({ server }: Props) {
if (role !== 'default' && typeof roles[role] === 'undefined') {
useEffect(() => setRole('default'));
- return;
+ return <>>;
}
const v = (id: string) => I32ToU32(id === 'default' ? server.default_permissions : roles[id].permissions)