Skip to content

Commit

Permalink
Improve usage of config and i18n #7972
Browse files Browse the repository at this point in the history
  • Loading branch information
anatol-sialitski committed Oct 22, 2024
1 parent 8f59617 commit a24cd25
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions modules/app/src/main/resources/assets/js/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -645,9 +645,7 @@ function initProjectContext(application: Application): Q.Promise<void> {
}

CONFIG.setConfig(JSON.parse(document.getElementById(configScriptId).innerText) as JSONObject);
if (Messages.isEmpty()) {
Messages.setMessages(JSON.parse(CONFIG.getString('phrasesAsJson')) as object);
}
Messages.addMessages(JSON.parse(CONFIG.getString('phrasesAsJson')) as object);

const body = Body.get();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,7 @@ export class LiveEditPage {
}

CONFIG.setConfig(event.getConfig());
if (Messages.isEmpty()) {
Messages.setMessages(JSON.parse(CONFIG.getString('phrasesAsJson')) as object);
}
Messages.addMessages(JSON.parse(CONFIG.getString('phrasesAsJson')) as object);

ProjectContext.get().setProject(Project.fromJson(event.getProjectJson()));
PageState.setState(event.getPageJson() ? new PageBuilder().fromJson(event.getPageJson()).build() : null);
Expand Down

0 comments on commit a24cd25

Please sign in to comment.