mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-31 02:21:35 +00:00
Add Telegram context on UserGen response
This commit is contained in:
parent
91e5db2bb9
commit
f2cd20c8f0
@ -736,7 +736,6 @@ class UserView(APIView):
|
|||||||
user.profile.referred_by = queryset[0]
|
user.profile.referred_by = queryset[0]
|
||||||
|
|
||||||
user.profile.wants_stealth = False
|
user.profile.wants_stealth = False
|
||||||
|
|
||||||
user.profile.save()
|
user.profile.save()
|
||||||
|
|
||||||
context["public_key"] = user.profile.public_key
|
context["public_key"] = user.profile.public_key
|
||||||
@ -755,6 +754,9 @@ class UserView(APIView):
|
|||||||
context["referral_code"] = str(user.profile.referral_code)
|
context["referral_code"] = str(user.profile.referral_code)
|
||||||
context["wants_stealth"] = user.profile.wants_stealth
|
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
|
# return active order or last made order if any
|
||||||
has_no_active_order, _, order = Logics.validate_already_maker_or_taker(request.user)
|
has_no_active_order, _, order = Logics.validate_already_maker_or_taker(request.user)
|
||||||
if not has_no_active_order:
|
if not has_no_active_order:
|
||||||
|
@ -3,9 +3,6 @@ import {
|
|||||||
BrowserRouter as Router,
|
BrowserRouter as Router,
|
||||||
Switch,
|
Switch,
|
||||||
Route,
|
Route,
|
||||||
Link,
|
|
||||||
Redirect,
|
|
||||||
useHistory,
|
|
||||||
} from 'react-router-dom';
|
} from 'react-router-dom';
|
||||||
|
|
||||||
import UserGenPage from './UserGenPage';
|
import UserGenPage from './UserGenPage';
|
||||||
|
@ -98,6 +98,9 @@ class UserGenPage extends Component {
|
|||||||
earnedRewards: data.earned_rewards,
|
earnedRewards: data.earned_rewards,
|
||||||
lastOrderId: data.last_order_id ? data.last_order_id : null,
|
lastOrderId: data.last_order_id ? data.last_order_id : null,
|
||||||
stealthInvoices: data.wants_stealth,
|
stealthInvoices: data.wants_stealth,
|
||||||
|
tgEnabled: data.tg_enabled,
|
||||||
|
tgBotName: data.tg_bot_name,
|
||||||
|
tgToken: data.tg_token,
|
||||||
})
|
})
|
||||||
: this.props.setAppState({
|
: this.props.setAppState({
|
||||||
nickname: data.nickname,
|
nickname: data.nickname,
|
||||||
|
Loading…
Reference in New Issue
Block a user