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:
parent
46542632b5
commit
aa62dcfbcd
3 changed files with 19 additions and 4 deletions
|
@ -122,11 +122,23 @@ const ProfileAccountsUnconnected: FC<IProps> = ({
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<Group horizontal className={styles.buttons}>
|
<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>
|
||||||
|
|
||||||
<Button size="small" iconLeft="google" color="gray" onClick={openOauthWindow('google')}>
|
<Button
|
||||||
|
size="small"
|
||||||
|
type="button"
|
||||||
|
iconLeft="google"
|
||||||
|
color="gray"
|
||||||
|
onClick={openOauthWindow('google')}
|
||||||
|
>
|
||||||
Google
|
Google
|
||||||
</Button>
|
</Button>
|
||||||
</Group>
|
</Group>
|
||||||
|
|
|
@ -35,6 +35,7 @@ export const ERRORS = {
|
||||||
USER_EXIST_WITH_SOCIAL: 'User_Exist_With_Social',
|
USER_EXIST_WITH_SOCIAL: 'User_Exist_With_Social',
|
||||||
USER_EXIST_WITH_USERNAME: 'User_Exist_With_Username',
|
USER_EXIST_WITH_USERNAME: 'User_Exist_With_Username',
|
||||||
CANT_SAVE_COMMENT: 'CantSaveComment',
|
CANT_SAVE_COMMENT: 'CantSaveComment',
|
||||||
|
CANT_SAVE_NODE: 'CantSaveNode',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const ERROR_LITERAL = {
|
export const ERROR_LITERAL = {
|
||||||
|
@ -75,4 +76,5 @@ export const ERROR_LITERAL = {
|
||||||
[ERRORS.USER_EXIST_WITH_SOCIAL]: 'У кого-то уже привязан этот аккаунт',
|
[ERRORS.USER_EXIST_WITH_SOCIAL]: 'У кого-то уже привязан этот аккаунт',
|
||||||
[ERRORS.USER_EXIST_WITH_USERNAME]: 'Имя пользователя занято',
|
[ERRORS.USER_EXIST_WITH_USERNAME]: 'Имя пользователя занято',
|
||||||
[ERRORS.CANT_SAVE_COMMENT]: 'Не удалось сохранить коммент',
|
[ERRORS.CANT_SAVE_COMMENT]: 'Не удалось сохранить коммент',
|
||||||
|
[ERRORS.CANT_SAVE_NODE]: 'Не удалось сохранить пост',
|
||||||
};
|
};
|
||||||
|
|
|
@ -82,6 +82,7 @@ function* onNodeSave({ node }: ReturnType<typeof nodeSave>) {
|
||||||
yield put(nodeSetSaveErrors({}));
|
yield put(nodeSetSaveErrors({}));
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
error,
|
||||||
data: { errors, node: result },
|
data: { errors, node: result },
|
||||||
} = yield call(reqWrapper, postNode, { node });
|
} = yield call(reqWrapper, postNode, { node });
|
||||||
|
|
||||||
|
@ -89,8 +90,8 @@ function* onNodeSave({ node }: ReturnType<typeof nodeSave>) {
|
||||||
return yield put(nodeSetSaveErrors(errors));
|
return yield put(nodeSetSaveErrors(errors));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!result || !result.id) {
|
if (error || !result || !result.id) {
|
||||||
return yield put(nodeSetSaveErrors({ error: ERRORS.EMPTY_RESPONSE }));
|
return yield put(nodeSetSaveErrors({ error: error || ERRORS.CANT_SAVE_NODE }));
|
||||||
}
|
}
|
||||||
|
|
||||||
const nodes = yield select(selectFlowNodes);
|
const nodes = yield select(selectFlowNodes);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue