GoogleChromeLabs / pwa-workshop-codelab

Apache License 2.0
156 stars 207 forks source link

Undefined value of screens #2

Open mukeshgurpude opened 3 years ago

mukeshgurpude commented 3 years ago

In actions.js below code is used to get the array with multiple screens..

// Line 151 of actions.js, Branch: pwa06--service-worker-includes
const { screens } = await window.getScreens()

It throws below error when preview is triggered, as window.getScreens returns an array not an object..

image

Quick, fix to this error might be to just assign the array directly to screens variable, by removing curly braces

const screens  = await window.getScreens();

Alternatively, maybe global variable screen can be used to show the preview at correct position image