Skip to content

Conversation

@a-stewart
Copy link
Contributor

This PR fixes #143197

Logic based on if the window is standalone should be based on if it is currently standalone, rather than if it was standalone when VS Code was started.

@bpasero
Copy link
Member

bpasero commented Feb 16, 2022

Looks pretty cool, I was not aware that MediaQueryList offers a change event 👏

@rebornix wanna give it a second pair of eyes, given you originally added this property?

@a-stewart
Copy link
Contributor Author

a-stewart commented Feb 16, 2022

Looks like addEventListener is deprecated now in favour of onchange. I'll update

Edit: ignore me, it was addListener that was deprecated, not addEventListener

This seems to already be defined in dom.ts. Importing dom would create a circular dependency, but we could move this method into browser.ts and re-export from dom.ts if you think that would be cleaner.

@rebornix
Copy link
Member

@a-stewart thanks for the contribution, didn't know there is an event emitter for the mode change, really nice!

@a-stewart
Copy link
Contributor Author

@rebornix - there is a potentially cleaner way of doing it if we move the existing watcher from dom.ts into browser.ts:

https://github.com/a-stewart/vscode/compare/make-isStandalone-a-method...a-stewart:addMatchMediaChangeLIstener-in-browser-ts?expand=1

WDYT?

@bpasero
Copy link
Member

bpasero commented Feb 17, 2022

Yeah sounds good to move that.

@a-stewart
Copy link
Contributor Author

I've creating another PR with the handler moved to dom.ts: #143287

@a-stewart a-stewart closed this Feb 17, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Apr 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

isStandalone is a const which is wrong if the state changes

5 participants