Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Increase textarea debounce time for custom markup

Chocobozzz6a056bbe4df1
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-homepage.component.html b/client/src/app/+admin/config/edit-custom-config/edit-homepage.component.html
index 5339240bb1..3d8414f5c7 100644
--- a/client/src/app/+admin/config/edit-custom-config/edit-homepage.component.html
+++ b/client/src/app/+admin/config/edit-custom-config/edit-homepage.component.html
@@ -17,7 +17,7 @@
<my-markdown-textarea
name="instanceCustomHomepageContent" formControlName="content"
- [customMarkdownRenderer]="getCustomMarkdownRenderer()"
+ [customMarkdownRenderer]="getCustomMarkdownRenderer()" [debounceTime]="500"
[formError]="formErrors['instanceCustomHomepage.content']"
></my-markdown-textarea>
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-instance-information.component.html b/client/src/app/+admin/config/edit-custom-config/edit-instance-information.component.html
index b54733327f..504afa189e 100644
--- a/client/src/app/+admin/config/edit-custom-config/edit-instance-information.component.html
+++ b/client/src/app/+admin/config/edit-custom-config/edit-instance-information.component.html
@@ -38,7 +38,7 @@
<my-markdown-textarea
name="instanceDescription" formControlName="description"
- [customMarkdownRenderer]="getCustomMarkdownRenderer()"
+ [customMarkdownRenderer]="getCustomMarkdownRenderer()" [debounceTime]="500"
[formError]="formErrors['instance.description']"
></my-markdown-textarea>
</div>
diff --git a/client/src/app/shared/shared-forms/markdown-textarea.component.ts b/client/src/app/shared/shared-forms/markdown-textarea.component.ts
index e3371f22c7..c6527e1696 100644
--- a/client/src/app/shared/shared-forms/markdown-textarea.component.ts
+++ b/client/src/app/shared/shared-forms/markdown-textarea.component.ts
@@ -31,6 +31,8 @@ export class MarkdownTextareaComponent implements ControlValueAccessor, OnInit {
@Input() markdownType: 'text' | 'enhanced' = 'text'
@Input() customMarkdownRenderer?: (text: string) => Promise<string | HTMLElement>
+ @Input() debounceTime = 150
+
@Input() markdownVideo: Video
@Input() name = 'description'
@@ -59,7 +61,7 @@ export class MarkdownTextareaComponent implements ControlValueAccessor, OnInit {
ngOnInit () {
this.contentChanged
.pipe(
- debounceTime(150),
+ debounceTime(this.debounceTime),
distinctUntilChanged()
)
.subscribe(() => this.updatePreviews())