Skip to content

Commit

Permalink
Make extraction modelTitle more stable
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristophNiehoff committed Sep 3, 2021
1 parent 2d85af2 commit 28fbbef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/server/endpoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ export const downloadThreatsMarkdownFile = gameServer => async ctx => {
const threats = getThreats(game.state, game.metadata, (isJsonModel) ? game.model : undefined);

const modelTitle = (isJsonModel && game.model)
? game.model.summary.title.trim().replaceAll(' ', '-')
: game.state.G.gameMode.trim().replaceAll(' ', '');
? ((!!game.model) ? game.model.summary.title.trim().replaceAll(' ', '-') : ``)
: ((!!game.state.G.gameMode) ? game.state.G.gameMode.trim().replaceAll(' ', '') : ``);
const timestamp = new Date().toISOString().replaceAll(':', '-');
const date = new Date().toLocaleString();
const filename = `threats-${modelTitle}-${timestamp}.md`
Expand Down

0 comments on commit 28fbbef

Please sign in to comment.