Skip to content

Commit a4a20d4

Browse files
authored
Ensure Canvas Has Changed Before Event Firing
1 parent c36a787 commit a4a20d4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

view/frontend/templates/canvas.phtml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,13 @@ $canvasBlockName = $canvasViewModel->getCanvasBlockName($block);
215215

216216
submitCanvas()
217217
{
218-
this.canvasImage = this.canvas.toDataURL();
218+
const canvasImage = this.canvas.toDataURL();
219219

220-
if (this.canvasImage !== this.canvasImageDefault) {
220+
if (this.canvasImage !== this.canvasImageDefault
221+
&& this.canvasImage !== canvasImage
222+
) {
223+
this.canvasImage = canvasImage;
224+
221225
window.dispatchEvent(new CustomEvent(
222226
'customer-canvas-submitted',
223227
{

0 commit comments

Comments
 (0)