From 2feb860f3b08e854d92a10f8a1c9b9765694ee67 Mon Sep 17 00:00:00 2001 From: devland <5208532+devland@users.noreply.github.com> Date: Wed, 20 Sep 2023 10:55:22 +0200 Subject: [PATCH] JI-5467 return null when resume state is empty (#86) --- src/scripts/h5p-crossword-content.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/scripts/h5p-crossword-content.js b/src/scripts/h5p-crossword-content.js index 9904cc7..3b2dbb3 100644 --- a/src/scripts/h5p-crossword-content.js +++ b/src/scripts/h5p-crossword-content.js @@ -280,10 +280,15 @@ export default class CrosswordContent { return; } + const cells = this.table.getAnswers(); + const focus = this.table.getFocus(); + if (!cells.find((item) => item !== undefined) && typeof focus.position.row === 'undefined') { + return; + } return { crosswordLayout: this.crosswordLayout, - cells: this.table.getAnswers(), - focus: this.table.getFocus() + cells, + focus }; }