GoogleChromeLabs / GoogleChromeLabs/pwa-workshop-codelab
Undefined value of screens
- Dominant language
- JavaScript
- Stars
- 166
- Forks
- 224
- PR merge metrics
- No merged PRs in 30d
Description
In [actions.js](https://github.com/GoogleChromeLabs/pwa-workshop-codelab/blob/pwa06--service-worker-includes/js/lib/actions.js) below code is used to get the array with multiple screens..
```js
// 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..

> Quick, fix to this error might be to just assign the array directly to `screens` variable, by removing curly braces
```js
const screens = await window.getScreens();
```
Alternatively, maybe global variable `screen` can be used to show the preview at correct position

Contributor guide
Research direction
Start in js/lib/actions.js around line 151 and trigger the preview to inspect the value returned by window.getScreens(). Confirm whether the returned value matches the destructuring used there and verify the preview displays the screens at the intended position without an error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100