OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Cache weekdays so only loaded once
Oliver Günthera9814ed04043
diff --git a/frontend/src/app/core/days/weekday.service.ts b/frontend/src/app/core/days/weekday.service.tsindex 5b4a63e0bc5..5fcfd805083 100644--- a/frontend/src/app/core/days/weekday.service.ts+++ b/frontend/src/app/core/days/weekday.service.ts@@ -38,13 +38,16 @@ import {import { InjectField } from 'core-app/shared/helpers/angular/inject-field.decorator';import { WeekdayResourceService } from 'core-app/core/state/days/weekday.service';import { IWeekday } from 'core-app/core/state/days/weekday.model';-import { Observable } from 'rxjs';+import {+ Observable,+ of,+} from 'rxjs';@Injectable({ providedIn: 'root' })export class WeekdayService {@InjectField() weekdaysService:WeekdayResourceService;- private weekdays:IWeekday[] = [];+ private weekdays:IWeekday[];constructor(readonly injector:Injector,@@ -60,6 +63,10 @@ export class WeekdayService {}loadWeekdays():Observable<IWeekday[]> {+ if (this.weekdays) {+ return of(this.weekdays);+ }+return this.weekdaysService.require()