Add Telegram context on UserGen response

This commit is contained in:
Reckless_Satoshi 2022-09-16 09:45:09 -07:00
parent 91e5db2bb9
commit f2cd20c8f0
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
3 changed files with 6 additions and 4 deletions

View File

@ -736,7 +736,6 @@ class UserView(APIView):
user.profile.referred_by = queryset[0]
user.profile.wants_stealth = False
user.profile.save()
context["public_key"] = user.profile.public_key
@ -755,6 +754,9 @@ class UserView(APIView):
context["referral_code"] = str(user.profile.referral_code)
context["wants_stealth"] = user.profile.wants_stealth
# Adds/generate telegram token and whether it is enabled
context = {**context,**Telegram.get_context(user)}
# return active order or last made order if any
has_no_active_order, _, order = Logics.validate_already_maker_or_taker(request.user)
if not has_no_active_order:

View File

@ -3,9 +3,6 @@ import {
BrowserRouter as Router,
Switch,
Route,
Link,
Redirect,
useHistory,
} from 'react-router-dom';
import UserGenPage from './UserGenPage';

View File

@ -98,6 +98,9 @@ class UserGenPage extends Component {
earnedRewards: data.earned_rewards,
lastOrderId: data.last_order_id ? data.last_order_id : null,
stealthInvoices: data.wants_stealth,
tgEnabled: data.tg_enabled,
tgBotName: data.tg_bot_name,
tgToken: data.tg_token,
})
: this.props.setAppState({
nickname: data.nickname,