1
0
mirror of https://github.com/spacebarchat/client.git synced 2024-11-25 11:42:30 +01:00
This commit is contained in:
Puyodead1 2023-04-30 16:56:03 -04:00
parent 7555f81ef4
commit 9797007d3b
No known key found for this signature in database
GPG Key ID: A4FA4FEC0DD353FC
10 changed files with 24 additions and 21 deletions

View File

@ -5,8 +5,9 @@
"root": true,
"rules": {
"no-mixed-spaces-and-tabs": "off",
"@typescript-eslint/no-inferrable-types": "off", // Required by typeorm
"@typescript-eslint/no-var-requires": "off" // Sometimes requred by typeorm to resolve circular deps
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-unused-vars": "off"
},
"env": {
"node": true

View File

@ -107,7 +107,7 @@ export class DOBInput extends Component<Props, State> {
},
};
componentDidUpdate(prevProps: any, prevState: any) {
componentDidUpdate(prevProps: Props, prevState: State) {
if (prevState !== this.state) {
this.props.onErrorChange(this.state.errors);

View File

@ -55,7 +55,7 @@ interface Props {
captchaRef: React.RefObject<HCaptchaLib>;
onLoad?: () => void;
onChalExpired?: () => void;
onError?: (e: any) => void;
onError?: (e: unknown) => void;
onExpire?: () => void;
onVerify?: (token: string) => void;
}

View File

@ -21,7 +21,6 @@ function Icon(props: IconProps) {
},
});
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { iconName, ...propSpread } = props;
return <ElementIcon {...propSpread} />;
}

View File

@ -56,11 +56,11 @@ const Header = styled.h1`
color: var(--text);
`;
const SubHeader = styled.h2`
color: var(--text-muted);
font-weight: 400;
font-size: 16px;
`;
// const SubHeader = styled.h2`
// color: var(--text-muted);
// font-weight: 400;
// font-size: 16px;
// `;
const FormContainer = styled.form`
width: 100%;
@ -164,7 +164,7 @@ function RegistrationPage() {
clearErrors,
} = useForm<FormValues>();
const dobRegister = register("date_of_birth", {
const _ = register("date_of_birth", {
required: true,
pattern: /^\d{4}-\d{2}-\d{2}$/,
});

View File

@ -12,10 +12,10 @@ export default class AccountStore {
@observable avatar: string | null;
@observable avatarDecoration?: unknown;
@observable email: string | null = null;
@observable verified: boolean = false;
@observable bot: boolean = false;
@observable system: boolean = false;
@observable mfaEnabled: boolean = false;
@observable verified = false;
@observable bot = false;
@observable system = false;
@observable mfaEnabled = false;
@observable premiumType?:
| UserPremiumType.NitroClassic
| UserPremiumType.Nitro

View File

@ -47,8 +47,8 @@ export default class GatewayConnectionStore {
private dispatchHandlers: Map<GatewayDispatchEvents, Function> = new Map();
private connectionStartTime?: number;
private identifyStartTime?: number;
private sequence: number = 0;
private heartbeatAck: boolean = true;
private sequence = 0;
private heartbeatAck = true;
private lazyRequestChannels = new Map<string, Snowflake[]>(); // guild, channels
constructor(app: AppStore) {
@ -154,6 +154,7 @@ export default class GatewayConnectionStore {
this.handleIdentify();
};
// eslint-disable-next-line @typescript-eslint/no-explicit-any
private onmessage = (e: MessageEvent<any>) => {
const payload: GatewayReceivePayload = JSON.parse(e.data);
if (payload.op !== GatewayOpcodes.Dispatch) {

View File

@ -13,11 +13,11 @@ export default class User {
@observable username: string;
@observable discriminator: string;
@observable avatar: string | null;
@observable bot: boolean = false;
@observable public_flags: number = 0;
@observable bio: string = "";
@observable bot = false;
@observable public_flags = 0;
@observable bio = "";
@observable premium_since: string | null = null;
@observable premium_type: number = 0;
@observable premium_type = 0;
@observable accent_color: unknown | null;
@observable pronouns?: string;
@observable theme_colors?: unknown;

View File

@ -2,6 +2,7 @@ export type OneKeyFrom<
T,
M = object,
K extends keyof T = keyof T,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
> = K extends any
? M &
Pick<Required<T>, K> &

View File

@ -24,6 +24,7 @@ export function messageFromFieldError(
return r ? { field: prevKey, error: r.message } : null;
}
if (typeof obj === "object") {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return messageFromFieldError(obj as any, key);
}
}