...
 
Commits (11)
......@@ -63,7 +63,7 @@ export class MindsAvatar {
if (this.object.type !== 'user') {
this.src = `${this.minds.cdn_url}fs/v1/avatars/${this.object.guid}/large/${this.object.icontime}`;
} else if (this.object.guid !== this.minds.user.guid) {
} else if (!this.minds.user || this.object.guid !== this.minds.user.guid) {
this.src = `${this.minds.cdn_url}icon/${this.object.guid}/large/${this.object.icontime}`;
}
}
......@@ -130,6 +130,6 @@ export class MindsAvatar {
* @returns true if the object guid matches the currently logged in user guid
*/
isOwnerAvatar(): boolean {
return this.object.guid === this.minds.user.guid;
return this.minds.user && this.object.guid === this.minds.user.guid;
}
}
......@@ -22,7 +22,7 @@ export class NSFWSelectorComponent {
@Input('service') serviceRef: string = 'consumer';
@Input('consumer') consumer: false;
@Input('expanded') expanded: false;
@Output('selected') onSelected: EventEmitter<any> = new EventEmitter();
@Output('selectedChange') onSelected: EventEmitter<any> = new EventEmitter();
constructor(
public creatorService: NSFWSelectorCreatorService,
......@@ -33,7 +33,9 @@ export class NSFWSelectorComponent {
ngOnInit() {
if (this.service.reasons) {
this.service.reasons.map(r => this.toggle(r.value));
for (const reason of this.service.reasons) {
this.toggle(reason.value, false);
}
}
}
......@@ -64,14 +66,17 @@ export class NSFWSelectorComponent {
}
}
toggle(reason) {
toggle(reason, triggerChange = true) {
if (reason.locked) {
return;
}
this.service.toggle(reason);
const reasons = this.service.reasons.filter(r => r.selected);
this.onSelected.next(reasons);
if (triggerChange) {
const reasons = this.service.reasons.filter(r => r.selected);
this.onSelected.next(reasons);
}
}
hasSelections(): boolean {
......
......@@ -231,7 +231,7 @@
<m-nsfw-selector
service="editing"
[selected]="entity.nsfw"
(selected)="onNSFWSelected($event)"
(selectedChange)="onNSFWSelected($event)"
>
</m-nsfw-selector>
</li>
......
......@@ -71,16 +71,7 @@ const routes: Routes = [
path: 'analytics',
component: AnalyticsComponent,
children: [
{ path: '', redirectTo: 'channel', pathMatch: 'full' },
{
path: 'channel',
component: ChannelAnalyticsComponent,
children: [
{ path: '', redirectTo: 'activity', pathMatch: 'full' },
{ path: 'activity', component: ChannelGeneralAnalyticsComponent },
{ path: 'reach', component: ChannelReachAnalyticsComponent },
],
},
{ path: '', redirectTo: 'dashboard/', pathMatch: 'full' },
{
path: 'admin',
component: AdminAnalyticsComponent,
......
......@@ -119,7 +119,7 @@
.minds-counter {
font-size: 12px;
line-height: 16px;
vertical-align: top;
vertical-align: middle;
}
}
}
......
......@@ -134,7 +134,7 @@ import { Session } from '../../../services/session';
<m-nsfw-selector
service="editing"
[selected]="group.nsfw"
(selected)="onNSFWSelected($event)"
(selectedChange)="onNSFWSelected($event)"
>
</m-nsfw-selector>
</li>
......
......@@ -115,7 +115,7 @@ import { BlockListService } from '../../../../common/services/block-list.service
<m-nsfw-selector
service="editing"
[selected]="user.nsfw_lock"
(selected)="setNSFWLock($event)"
(selectedChange)="setNSFWLock($event)"
>
</m-nsfw-selector>
</li>
......
......@@ -171,7 +171,7 @@
service="editing"
[selected]="activity.nsfw"
[locked]="activity.ownerObj.nsfw_lock"
(selected)="onNSWFSelections($event)"
(selectedChange)="onNSWFSelections($event)"
>
</m-nsfw-selector>
</ng-container>
......
......@@ -2,7 +2,7 @@
<ng-container *mIfFeature="'top-feeds'">
<m-nsfw-selector
[consumer]="true"
(selected)="onNSFWSelected($event)"
(selectedChange)="onNSFWSelected($event)"
></m-nsfw-selector>
</ng-container>
<ng-container *ngIf="showBoostOptions">
......
......@@ -60,7 +60,7 @@
</label>
<ng-container *mIfFeature="'top-feeds'; else oldNSFW">
<m-nsfw-selector (selected)="onNSWFSelections($event)">
<m-nsfw-selector (selectedChange)="onNSWFSelections($event)">
</m-nsfw-selector>
</ng-container>
......
<div *ngIf="eligible === false">
<p>
Due to Stripe's
<a href="https://stripe.com/restricted-businesses" target="_blank">
Terms of Use</a
>, this feature is currently unavailable for any channel determined to be
not safe for work (NSFW). If you are impacted by Stripe's terms and still
wish to monetize your channel, please consider onboarding to receive
payments in <a (click)="openBtc()">Bitcoin</a>,
<a routerLink="/wallet/tokens/addresses">Ether</a> or
<a routerLink="/wallet/tokens/addresses">Minds Tokens</a>.
</p>
</div>
<form
*ngIf="eligible === true"
(submit)="submit()"
[formGroup]="form"
#f="ngForm"
......
......@@ -13,6 +13,8 @@ import { Client } from '../../../../services/api';
import { requiredFor, optionalFor } from './onboarding.validators';
import { OverlayModalService } from '../../../../services/ux/overlay-modal';
import { WalletUSDTermsComponent } from '../terms.component';
import { Session } from '../../../../services/session';
import { BTCSettingsComponent } from '../../../payments/btc/settings.component';
@Component({
selector: 'm-walletUsd__onboarding',
......@@ -22,6 +24,7 @@ export class WalletUSDOnboardingComponent implements OnInit {
form: FormGroup;
inProgress: boolean = false;
restrictAsVerified: boolean = false;
eligible: boolean;
minds = window.Minds;
merchant: any;
......@@ -36,7 +39,8 @@ export class WalletUSDOnboardingComponent implements OnInit {
private client: Client,
private cd: ChangeDetectorRef,
private router: Router,
protected overlayModal: OverlayModalService
protected overlayModal: OverlayModalService,
private session: Session
) {}
ngOnInit() {
......@@ -70,6 +74,12 @@ export class WalletUSDOnboardingComponent implements OnInit {
this.form.patchValue(this.merchant);
}
if (this.session.getLoggedInUser().nsfw.length > 0) {
this.eligible = false;
} else {
this.eligible = true;
}
this.disableRestrictedFields();
}
......@@ -180,6 +190,10 @@ export class WalletUSDOnboardingComponent implements OnInit {
this.overlayModal.create(WalletUSDTermsComponent).present();
}
openBtc() {
this.overlayModal.create(BTCSettingsComponent, {}).present();
}
detectChanges() {
this.cd.markForCheck();
this.cd.detectChanges();
......
This diff is collapsed.