Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

Commit

Permalink
Fix: Retry app checks with CORS (#28)
Browse files Browse the repository at this point in the history
This fix was originally created for ringtools, which has no CORS protection, but CORP https://developer.mozilla.org/en-US/docs/Web/HTTP/Cross-Origin_Resource_Policy_(CORP) which causes no-cors requests to fail
  • Loading branch information
AaronDewes authored May 30, 2022
1 parent ef5ee1e commit d7854ec
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/components/InstalledApp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,15 @@ export default defineComponent({
await window.fetch(this.url, {mode: 'no-cors'});
this.isOffline = false;
this.checkIfAppIsOffline = false;
} catch (error) {
this.isOffline = true;
} catch {
await delay(1000);
try {
await window.fetch(this.url);
this.isOffline = false;
this.checkIfAppIsOffline = false;
} catch {
this.isOffline = true;
}
}
await delay(1000);
}
Expand Down

0 comments on commit d7854ec

Please sign in to comment.