Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disabled paywalls on responses #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h6 class="modal-title">Prepare your story for readers</h6>
[displayBy]="'hashtag'"
></tag-input>
<hr />
<div class="form-check">
<div *ngIf="paidSectionEnabled" class="form-check">
<input
class="form-check-input"
type="checkbox"
Expand Down Expand Up @@ -117,7 +117,7 @@ <h6 class="modal-title">Prepare your story for readers</h6>
</div>
</div>
</div>
<hr />
<hr *ngIf="paidSectionEnabled" />
<small
><strong>
<ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { PostService } from '@app/shared/services/post.service';
import { Post } from '@app/shared/interfaces';
import { WalletService, ICurrencyConversion, ICurrencyConversionResponse } from '@app/shared/services/wallet.service';

let bodyHTML: string = '';
let _bodyHTML: string = '';
let bodyHTML = '';
let _bodyHTML = '';

const ridMapFunction = (j: number, el: any) => {
const $el = $(el);
Expand Down Expand Up @@ -54,12 +54,13 @@ const getRidOfStackeditWrapper = (body: string) => {
})
export class PostPublishModalComponent {
post: Post;
paidSectionEnabled: boolean;
paidSectionCostInUSD: number;
bchUsdRate: number;
showPaidSectionCostInUSD: boolean = false;
showPaidSectionCostInUSD = false;
bodyHTML: string;
paidSectionLinebreakEnd: number = 0;
paidSectionLineBreakTouched: boolean = false;
paidSectionLinebreakEnd = 0;
paidSectionLineBreakTouched = false;

constructor(
public activeModal: NgbActiveModal,
Expand All @@ -73,6 +74,10 @@ export class PostPublishModalComponent {
this.bodyHTML = getRidOfStackeditWrapper(this.bodyHTML);
this.paidSectionLinebreakEnd = $(this.bodyHTML).length;

setTimeout(() => {
this.paidSectionEnabled = this.post.parentPostId ? false : true;
});

if (!this.bchUsdRate) {
this.walletService.getCurrencyData().subscribe((response: ICurrencyConversionResponse) => {
this.bchUsdRate = Number(response.data.rates.USD);
Expand Down