Skip to content

Commit b4e9959

Browse files
author
Lionel Laské
committed
Merge branch 'pr/1703' into dev
2 parents d54706c + c234a15 commit b4e9959

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
3939
- Unusual Draw in Chess Activity #1678
4040
- Pressing the start button in ColorMyWorld activity immediately shows "Congratulations! You finished!" #1691
4141
- Broken dialog box on first screen tutorial #1418
42+
- Sample values in Chart activity are not initialized #1695
4243

4344
## [1.8.0] - 2024-04-10
4445
### Added

activities/Chart.activity/js/activity.js

+12
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ const app = new Vue({
2222
"csv-view": CsvView,
2323
},
2424
data: {
25+
isLocalized: false,
26+
pendingNewInstance: false,
2527
currentenv: null,
2628
SugarL10n: null,
2729
SugarPresence: null,
@@ -145,9 +147,15 @@ const app = new Vue({
145147
});
146148
},
147149
localized() {
150+
this.isLocalized = true;
148151
this.SugarL10n.localize(this.l10n);
149152
document.getElementById("export-csv-button").title = this.l10n.stringexportAsCSV;
150153
document.getElementById("export-img-button").title = this.l10n.stringSaveImage;
154+
// If onJournalNewInstance was triggered before localization
155+
if (this.pendingNewInstance) {
156+
this.onJournalNewInstance(); // Execute the pending call
157+
this.pendingNewInstance = false;
158+
}
151159

152160
},
153161

@@ -270,6 +278,10 @@ const app = new Vue({
270278

271279

272280
onJournalNewInstance() {
281+
if (!this.isLocalized) {
282+
this.pendingNewInstance = true; // Mark the call as pending
283+
return;
284+
}
273285
const randArr = this.shuffleArray([1, 2, 3, 4, 5, 6]);
274286
for(let i = 0; i < 3; i++) {
275287
const label = "EgLabel" + randArr[i];

0 commit comments

Comments
 (0)