1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 04:46:40 +07:00

fixed social account settings role buttons

This commit is contained in:
Fedor Katurov 2020-08-26 13:15:10 +07:00
parent 46542632b5
commit aa62dcfbcd
3 changed files with 19 additions and 4 deletions

View file

@ -122,11 +122,23 @@ const ProfileAccountsUnconnected: FC<IProps> = ({
)}
<Group horizontal className={styles.buttons}>
<Button size="small" iconLeft="vk" color="gray" onClick={openOauthWindow('vkontakte')}>
<Button
size="small"
type="button"
iconLeft="vk"
color="gray"
onClick={openOauthWindow('vkontakte')}
>
Вконтакте
</Button>
<Button size="small" iconLeft="google" color="gray" onClick={openOauthWindow('google')}>
<Button
size="small"
type="button"
iconLeft="google"
color="gray"
onClick={openOauthWindow('google')}
>
Google
</Button>
</Group>

View file

@ -35,6 +35,7 @@ export const ERRORS = {
USER_EXIST_WITH_SOCIAL: 'User_Exist_With_Social',
USER_EXIST_WITH_USERNAME: 'User_Exist_With_Username',
CANT_SAVE_COMMENT: 'CantSaveComment',
CANT_SAVE_NODE: 'CantSaveNode',
};
export const ERROR_LITERAL = {
@ -75,4 +76,5 @@ export const ERROR_LITERAL = {
[ERRORS.USER_EXIST_WITH_SOCIAL]: 'У кого-то уже привязан этот аккаунт',
[ERRORS.USER_EXIST_WITH_USERNAME]: 'Имя пользователя занято',
[ERRORS.CANT_SAVE_COMMENT]: 'Не удалось сохранить коммент',
[ERRORS.CANT_SAVE_NODE]: 'Не удалось сохранить пост',
};

View file

@ -82,6 +82,7 @@ function* onNodeSave({ node }: ReturnType<typeof nodeSave>) {
yield put(nodeSetSaveErrors({}));
const {
error,
data: { errors, node: result },
} = yield call(reqWrapper, postNode, { node });
@ -89,8 +90,8 @@ function* onNodeSave({ node }: ReturnType<typeof nodeSave>) {
return yield put(nodeSetSaveErrors(errors));
}
if (!result || !result.id) {
return yield put(nodeSetSaveErrors({ error: ERRORS.EMPTY_RESPONSE }));
if (error || !result || !result.id) {
return yield put(nodeSetSaveErrors({ error: error || ERRORS.CANT_SAVE_NODE }));
}
const nodes = yield select(selectFlowNodes);