1212// See the License for the specific language governing permissions and
1313// limitations under the License.
1414
15- import { Component , Input , Output , EventEmitter , OnInit , OnDestroy , HostBinding } from '@angular/core' ;
15+ import { Component , Input , Output , EventEmitter , OnInit , OnDestroy , HostBinding , signal } from '@angular/core' ;
1616
1717import { CoreSites } from '@services/sites' ;
1818import {
@@ -29,7 +29,6 @@ import {
2929} from '@features/course/services/module-prefetch-delegate' ;
3030import { CoreConstants , DownloadStatus } from '@/core/constants' ;
3131import { CoreEventObserver , CoreEvents } from '@singletons/events' ;
32- import { BehaviorSubject } from 'rxjs' ;
3332import { toBoolean } from '@/core/transforms/boolean' ;
3433import { CoreRemindersDateComponent } from '../../../reminders/components/date/date' ;
3534import { CoreCourseModuleCompletionComponent } from '../module-completion/module-completion' ;
@@ -74,9 +73,9 @@ export class CoreCourseModuleComponent implements OnInit, OnDestroy {
7473 modNameTranslated = '' ;
7574 hasCompletion = false ; // Whether activity has completion to be shown.
7675 showManualCompletion = false ; // Whether to show manual completion when completion conditions are disabled.
77- prefetchStatusIcon$ = new BehaviorSubject < string > ( '' ) ; // Module prefetch status icon.
78- prefetchStatusText$ = new BehaviorSubject < string > ( '' ) ; // Module prefetch status text.
7976 moduleHasView = true ;
77+ readonly prefetchStatusIcon = signal < string > ( '' ) ; // Module prefetch status icon.
78+ readonly prefetchStatusText = signal < string > ( '' ) ; // Module prefetch status text.
8079
8180 protected prefetchHandler ?: CoreCourseModulePrefetchHandler ;
8281
@@ -152,16 +151,16 @@ export class CoreCourseModuleComponent implements OnInit, OnDestroy {
152151
153152 switch ( prefetchStatus ) {
154153 case DownloadStatus . OUTDATED :
155- this . prefetchStatusIcon$ . next ( CoreConstants . ICON_OUTDATED ) ;
156- this . prefetchStatusText$ . next ( 'core.outdated' ) ;
154+ this . prefetchStatusIcon . set ( CoreConstants . ICON_OUTDATED ) ;
155+ this . prefetchStatusText . set ( 'core.outdated' ) ;
157156 break ;
158157 case DownloadStatus . DOWNLOADED :
159- this . prefetchStatusIcon$ . next ( CoreConstants . ICON_DOWNLOADED ) ;
160- this . prefetchStatusText$ . next ( 'core.downloaded' ) ;
158+ this . prefetchStatusIcon . set ( CoreConstants . ICON_DOWNLOADED ) ;
159+ this . prefetchStatusText . set ( 'core.downloaded' ) ;
161160 break ;
162161 default :
163- this . prefetchStatusIcon$ . next ( '' ) ;
164- this . prefetchStatusText$ . next ( '' ) ;
162+ this . prefetchStatusIcon . set ( '' ) ;
163+ this . prefetchStatusText . set ( '' ) ;
165164 break ;
166165 }
167166
0 commit comments