Disable tokenization if wallet address is not exposed via API
This commit is contained in:
parent
4aa085fd86
commit
8a51c79a6e
4 changed files with 10 additions and 5 deletions
|
@ -42,7 +42,7 @@ export function getVerifiedEthereumAddress(profile: Profile): string | null {
|
||||||
|
|
||||||
export interface User extends Profile {
|
export interface User extends Profile {
|
||||||
source: Source;
|
source: Source;
|
||||||
wallet_address: string;
|
wallet_address: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface UserCreateForm {
|
export interface UserCreateForm {
|
||||||
|
|
|
@ -463,6 +463,7 @@ export default class PostComponent extends Vue {
|
||||||
Boolean(this.store.instance?.blockchain_contract_address) &&
|
Boolean(this.store.instance?.blockchain_contract_address) &&
|
||||||
this.post.account.id === this.store.currentUser?.id &&
|
this.post.account.id === this.store.currentUser?.id &&
|
||||||
this.post.visibility === "public" &&
|
this.post.visibility === "public" &&
|
||||||
|
Boolean(this.store.currentUser?.wallet_address) &&
|
||||||
!this.isTokenized &&
|
!this.isTokenized &&
|
||||||
!this.isWaitingForToken
|
!this.isWaitingForToken
|
||||||
)
|
)
|
||||||
|
@ -472,6 +473,7 @@ export default class PostComponent extends Vue {
|
||||||
const { currentUser, instance } = this.store
|
const { currentUser, instance } = this.store
|
||||||
if (
|
if (
|
||||||
!currentUser ||
|
!currentUser ||
|
||||||
|
!currentUser.wallet_address ||
|
||||||
!instance ||
|
!instance ||
|
||||||
!instance.blockchain_contract_address
|
!instance.blockchain_contract_address
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -396,8 +396,7 @@ export default class ProfileView extends Vue {
|
||||||
// Only users with verified address can configure subscription
|
// Only users with verified address can configure subscription
|
||||||
return (
|
return (
|
||||||
Boolean(this.store.instance?.blockchain_contract_address) &&
|
Boolean(this.store.instance?.blockchain_contract_address) &&
|
||||||
this.profile !== null &&
|
Boolean(this.store.currentUser?.wallet_address) &&
|
||||||
getVerifiedEthereumAddress(this.profile) !== null &&
|
|
||||||
this.isCurrentUser()
|
this.isCurrentUser()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -184,13 +184,17 @@ async function checkSubscription() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function canConfigureSubscription(): boolean {
|
function canConfigureSubscription(): boolean {
|
||||||
// If wallet is not connected, subscriptionConfigured is set to null
|
return (
|
||||||
return isCurrentUser() && subscriptionConfigured === false
|
isCurrentUser() &&
|
||||||
|
currentUser.wallet_address &&
|
||||||
|
subscriptionConfigured === false
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onConfigureSubscription() {
|
async function onConfigureSubscription() {
|
||||||
if (
|
if (
|
||||||
!currentUser ||
|
!currentUser ||
|
||||||
|
!currentUser.wallet_address ||
|
||||||
!isCurrentUser() ||
|
!isCurrentUser() ||
|
||||||
!instance ||
|
!instance ||
|
||||||
!instance.blockchain_contract_address
|
!instance.blockchain_contract_address
|
||||||
|
|
Loading…
Reference in a new issue