-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: export head stream err recover script component (#6967)
* feat: export head stream err recover script component * fix: fix downgrade hostname * chore: update plugin-stream-error version * fix: head-stream-error independent export from plugin-stream-error * chore: changelog * chore: changelog
- Loading branch information
Showing
4 changed files
with
27 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
packages/plugin-stream-error/src/components/headStreamErrorRecoverScript.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from 'react'; | ||
|
||
export default function HeadStreamErrorRecoverScript({ downgradeCSRHostname }) { | ||
return ( | ||
<script | ||
dangerouslySetInnerHTML={{ | ||
__html: ` | ||
window.addEventListener('load', () => { | ||
if (!window._$ServerTimePoints && !window.__ICE_APP_CONTEXT__) { | ||
window.location.hostname = '${downgradeCSRHostname}'; | ||
} | ||
})`, | ||
} | ||
} | ||
Check failure on line 14 in packages/plugin-stream-error/src/components/headStreamErrorRecoverScript.tsx GitHub Actions / build (16.x, ubuntu-latest)
Check failure on line 14 in packages/plugin-stream-error/src/components/headStreamErrorRecoverScript.tsx GitHub Actions / build (16.x, windows-latest)
Check failure on line 14 in packages/plugin-stream-error/src/components/headStreamErrorRecoverScript.tsx GitHub Actions / build (18.x, ubuntu-latest)
|
||
crossOrigin="anonymous" | ||
/> | ||
); | ||
} |
File renamed without changes.