Skip to content

Commit

Permalink
chore: TS-ignore errors that cannot be easily solved
Browse files Browse the repository at this point in the history
  • Loading branch information
Ldoppea authored and Crash-- committed Sep 22, 2022
1 parent 2d7e643 commit 0d2f74a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/cozy-stack-client/src/CozyStackClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ class CozyStackClient {
try {
const response = await fetcher(fullPath, options)
if (!response.ok) {
// @ts-ignore - this.emit is added by MicroEE.mixin
this.emit(
'error',
new FetchError(response, `${response.status} ${response.statusText}`)
Expand Down
4 changes: 4 additions & 0 deletions packages/cozy-stack-client/src/urls.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ export function isSecureProtocol(urlArg) {
export function getBrowserCozyURL() {
try {
const root = document.querySelector('[role=application]')
// @ts-ignore
// to make this pass TS checks we should use type assertion with `as HTMLElement | null`
// which cannot be used as this project is not TS transpiled
// More details: https://bobbyhadz.com/blog/typescript-property-dataset-not-exist-type-element
const data = root.dataset

return new URL(`${window.location.protocol}//${data.cozyDomain}`)
Expand Down

0 comments on commit 0d2f74a

Please sign in to comment.