Commit 52359181 authored by Marcelo Rivera's avatar Marcelo Rivera

(feat): show errors in pro settings when saving

1 merge request!528WIP: (feat): Minds Pro
Pipeline #82449329 failed with stages
in 8 minutes and 11 seconds
......@@ -369,6 +369,13 @@
</ng-template>
</ng-container>
<div
class="m-pro--settings--error"
*ngIf="!!error"
>
{{ error }}
</div>
<div
class="m-pro--settings--field m-pro--settings--field-actions"
*ngIf="currentTab !== 'cancel'"
......
......@@ -132,4 +132,12 @@
.m-pro--settings--field-spinner {
margin-left: 0.65em;
}
.m-pro--settings--error {
margin: 16px 0;
font-size: 20px;
@include m-theme() {
color: themed($m-red);
}
}
}
......@@ -34,6 +34,8 @@ export class ProSettingsComponent implements OnInit, OnDestroy {
user: string | null = null;
error: string;
protected param$: Subscription;
constructor(
......@@ -83,7 +85,11 @@ export class ProSettingsComponent implements OnInit, OnDestroy {
this.inProgress = true;
this.detectChanges();
await this.service.set(this.settings, this.user);
try {
await this.service.set(this.settings, this.user);
} catch (e) {
this.error = e.message;
}
this.saved = true;
this.inProgress = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment