mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 13:05:32 +09:00
feat(api): defer registration phone verification to community joins (#1709)
This commit is contained in:
1 parent
7e1ca9ed6a
commit
d7b2e67c35
39 files changed
+1000
-32
No files matched your search
@@ -7,6 +7,7 @@ import * as NavigationCommands from '@app/features/navigation/commands/Navigatio
|
||||
import {failureCode} from '@app/features/platform/utils/ResponseInspection';
|
||||
import * as ModalCommands from '@app/features/ui/commands/ModalCommands';
|
||||
import {modal} from '@app/features/ui/commands/ModalCommands';
|
||||
import Users from '@app/features/user/state/Users';
|
||||
import {APIErrorCodes} from '@fluxer/constants/src/ApiErrorCodes';
|
||||
import {msg} from '@lingui/core/macro';
|
||||
|
||||
@@ -100,7 +101,11 @@ function resolveJoinGuildErrorContent(code: string | undefined): {title: string;
|
||||
}
|
||||
|
||||
function showJoinGuildErrorModal(error: unknown): void {
|
||||
const {title, message} = resolveJoinGuildErrorContent(failureCode(error));
|
||||
const code = failureCode(error);
|
||||
if (code === APIErrorCodes.ACCOUNT_SUSPICIOUS_ACTIVITY && (Users.currentUser?.requiredActions?.length ?? 0) > 0) {
|
||||
return;
|
||||
}
|
||||
const {title, message} = resolveJoinGuildErrorContent(code);
|
||||
ModalCommands.push(
|
||||
modal(() => <GenericErrorModal title={title} message={message} data-flx="discovery.join.generic-error-modal" />),
|
||||
);
|
||||
|
||||
@@ -174,6 +174,12 @@ function showGuildInviteAcceptFailure(
|
||||
responseErr: HttpError | null,
|
||||
): void {
|
||||
const isRaidDetected = guildInviteFeatures(invite).includes(GuildFeatures.RAID_DETECTED);
|
||||
if (
|
||||
errorCode === APIErrorCodes.ACCOUNT_SUSPICIOUS_ACTIVITY &&
|
||||
(Users.currentUser?.requiredActions?.length ?? 0) > 0
|
||||
) {
|
||||
return;
|
||||
}
|
||||
if (errorCode === APIErrorCodes.INVITES_DISABLED) {
|
||||
ModalCommands.push(
|
||||
modal(() => (
|
||||
|
||||
Reference in new issue
Block a user