MOBILE-4272 rte: Fix contentChanged event types

main
Noel De Martin 2023-07-25 15:38:28 +09:00
parent aeb12fa472
commit a07ae84f54
6 changed files with 10 additions and 10 deletions

View File

@ -111,7 +111,7 @@ export class AddonModAssignSubmissionOnlineTextComponent extends AddonModAssignS
* *
* @param text The new text. * @param text The new text.
*/ */
onChange(text: string): void { onChange(text?: string | null): void {
// Count words if needed. // Count words if needed.
if (this.wordLimitEnabled) { if (this.wordLimitEnabled) {
// Cancel previous wait. // Cancel previous wait.

View File

@ -332,8 +332,8 @@ export class AddonModForumPostComponent implements OnInit, OnDestroy, OnChanges
* *
* @param text The new text. * @param text The new text.
*/ */
onMessageChange(text: string): void { onMessageChange(text?: string | null): void {
this.formData.message = text; this.formData.message = text ?? '';
} }
/** /**

View File

@ -511,8 +511,8 @@ export class AddonModForumNewDiscussionPage implements OnInit, OnDestroy, CanLea
* *
* @param text The new text. * @param text The new text.
*/ */
onMessageChange(text: string): void { onMessageChange(text?: string | null): void {
this.newDiscussion.message = text; this.newDiscussion.message = text ?? '';
} }
/** /**

View File

@ -173,8 +173,8 @@ export class AddonModGlossaryEditPage implements OnInit, CanLeave {
* *
* @param text The new text. * @param text The new text.
*/ */
onDefinitionChange(text: string): void { onDefinitionChange(text?: string | null): void {
this.data.definition = text; this.data.definition = text ?? '';
} }
/** /**

View File

@ -403,8 +403,8 @@ export class AddonModWorkshopAssessmentStrategyComponent implements OnInit, OnDe
* *
* @param text The new text. * @param text The new text.
*/ */
onFeedbackChange(text: string): void { onFeedbackChange(text?: string | null): void {
this.feedbackText = text; this.feedbackText = text ?? '';
} }
/** /**

View File

@ -332,7 +332,7 @@ export class CoreTextUtilsProvider {
* @param text Text to count. * @param text Text to count.
* @returns Number of words. * @returns Number of words.
*/ */
countWords(text: string): number { countWords(text?: string | null): number {
if (!text || typeof text != 'string') { if (!text || typeof text != 'string') {
return 0; return 0;
} }