Skip to content

Commit

Permalink
add useVisualRefresh result to a global object
Browse files Browse the repository at this point in the history
  • Loading branch information
cansuaa committed Jan 14, 2025
1 parent 6d6dc33 commit 8c4a068
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/app-layout/internal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ import ToolbarAppLayout from './visual-refresh-toolbar';

export const AppLayoutInternal = React.forwardRef<AppLayoutProps.Ref, AppLayoutPropsWithDefaults>((props, ref) => {
const isRefresh = useVisualRefresh();
if (!(window as any).__awsuiDebug?.logs) {

Check failure on line 14 in src/app-layout/internal.tsx

View workflow job for this annotation

GitHub Actions / build / build

should render classic app layout

ReferenceError: window is not defined at Object.render (src/app-layout/internal.tsx:14:36) at ReactDOMServerRenderer.render (node_modules/react-dom/cjs/react-dom-server.node.development.js:3535:44) at ReactDOMServerRenderer.read (node_modules/react-dom/cjs/react-dom-server.node.development.js:3373:29) at renderToStaticMarkup (node_modules/react-dom/cjs/react-dom-server.node.development.js:4004:27) at Object.<anonymous> (src/app-layout/__tests__/app-layout.ssr.test.tsx:27:39)

Check failure on line 14 in src/app-layout/internal.tsx

View workflow job for this annotation

GitHub Actions / build / build

should render refresh app layout

ReferenceError: window is not defined at Object.render (src/app-layout/internal.tsx:14:36) at ReactDOMServerRenderer.render (node_modules/react-dom/cjs/react-dom-server.node.development.js:3535:44) at ReactDOMServerRenderer.read (node_modules/react-dom/cjs/react-dom-server.node.development.js:3373:29) at renderToStaticMarkup (node_modules/react-dom/cjs/react-dom-server.node.development.js:4004:27) at Object.<anonymous> (src/app-layout/__tests__/app-layout.ssr.test.tsx:32:39)

Check failure on line 14 in src/app-layout/internal.tsx

View workflow job for this annotation

GitHub Actions / build / build

should render refresh-toolbar app layout with the widget flag

ReferenceError: window is not defined at Object.render (src/app-layout/internal.tsx:14:36) at ReactDOMServerRenderer.render (node_modules/react-dom/cjs/react-dom-server.node.development.js:3535:44) at ReactDOMServerRenderer.read (node_modules/react-dom/cjs/react-dom-server.node.development.js:3373:29) at renderToStaticMarkup (node_modules/react-dom/cjs/react-dom-server.node.development.js:4004:27) at Object.<anonymous> (src/app-layout/__tests__/app-layout.ssr.test.tsx:38:39)

Check failure on line 14 in src/app-layout/internal.tsx

View workflow job for this annotation

GitHub Actions / build / build

should render refresh-toolbar app layout with the toolbar flag

ReferenceError: window is not defined at Object.render (src/app-layout/internal.tsx:14:36) at ReactDOMServerRenderer.render (node_modules/react-dom/cjs/react-dom-server.node.development.js:3535:44) at ReactDOMServerRenderer.read (node_modules/react-dom/cjs/react-dom-server.node.development.js:3373:29) at renderToStaticMarkup (node_modules/react-dom/cjs/react-dom-server.node.development.js:4004:27) at Object.<anonymous> (src/app-layout/__tests__/app-layout.ssr.test.tsx:44:39)

Check failure on line 14 in src/app-layout/internal.tsx

View workflow job for this annotation

GitHub Actions / build / build

renders app-layout without crashing

ReferenceError: window is not defined at Object.render (src/app-layout/internal.tsx:14:36) at ReactDOMServerRenderer.render (node_modules/react-dom/cjs/react-dom-server.node.development.js:3535:44) at ReactDOMServerRenderer.read (node_modules/react-dom/cjs/react-dom-server.node.development.js:3373:29) at renderToStaticMarkup (node_modules/react-dom/cjs/react-dom-server.node.development.js:4004:27) at Object.<anonymous> (src/__tests__/functional-tests/ssr.test.ts:22:41)

Check failure on line 14 in src/app-layout/internal.tsx

View workflow job for this annotation

GitHub Actions / dry-run / Components unit tests

should render classic app layout

ReferenceError: window is not defined at Object.window (src/app-layout/internal.tsx:14:9) at ReactDOMServerRenderer.render (node_modules/react-dom/cjs/react-dom-server.node.development.js:3535:44) at ReactDOMServerRenderer.read (node_modules/react-dom/cjs/react-dom-server.node.development.js:3373:29) at renderToStaticMarkup (node_modules/react-dom/cjs/react-dom-server.node.development.js:4004:27) at Object.<anonymous> (src/app-layout/__tests__/app-layout.ssr.test.tsx:27:39)

Check failure on line 14 in src/app-layout/internal.tsx

View workflow job for this annotation

GitHub Actions / dry-run / Components unit tests

should render refresh app layout

ReferenceError: window is not defined at Object.window (src/app-layout/internal.tsx:14:9) at ReactDOMServerRenderer.render (node_modules/react-dom/cjs/react-dom-server.node.development.js:3535:44) at ReactDOMServerRenderer.read (node_modules/react-dom/cjs/react-dom-server.node.development.js:3373:29) at renderToStaticMarkup (node_modules/react-dom/cjs/react-dom-server.node.development.js:4004:27) at Object.<anonymous> (src/app-layout/__tests__/app-layout.ssr.test.tsx:32:39)

Check failure on line 14 in src/app-layout/internal.tsx

View workflow job for this annotation

GitHub Actions / dry-run / Components unit tests

should render refresh-toolbar app layout with the widget flag

ReferenceError: window is not defined at Object.window (src/app-layout/internal.tsx:14:9) at ReactDOMServerRenderer.render (node_modules/react-dom/cjs/react-dom-server.node.development.js:3535:44) at ReactDOMServerRenderer.read (node_modules/react-dom/cjs/react-dom-server.node.development.js:3373:29) at renderToStaticMarkup (node_modules/react-dom/cjs/react-dom-server.node.development.js:4004:27) at Object.<anonymous> (src/app-layout/__tests__/app-layout.ssr.test.tsx:38:39)

Check failure on line 14 in src/app-layout/internal.tsx

View workflow job for this annotation

GitHub Actions / dry-run / Components unit tests

should render refresh-toolbar app layout with the toolbar flag

ReferenceError: window is not defined at Object.window (src/app-layout/internal.tsx:14:9) at ReactDOMServerRenderer.render (node_modules/react-dom/cjs/react-dom-server.node.development.js:3535:44) at ReactDOMServerRenderer.read (node_modules/react-dom/cjs/react-dom-server.node.development.js:3373:29) at renderToStaticMarkup (node_modules/react-dom/cjs/react-dom-server.node.development.js:4004:27) at Object.<anonymous> (src/app-layout/__tests__/app-layout.ssr.test.tsx:44:39)

Check failure on line 14 in src/app-layout/internal.tsx

View workflow job for this annotation

GitHub Actions / dry-run / Components unit tests

renders app-layout without crashing

ReferenceError: window is not defined at Object.window (src/app-layout/internal.tsx:14:9) at ReactDOMServerRenderer.render (node_modules/react-dom/cjs/react-dom-server.node.development.js:3535:44) at ReactDOMServerRenderer.read (node_modules/react-dom/cjs/react-dom-server.node.development.js:3373:29) at renderToStaticMarkup (node_modules/react-dom/cjs/react-dom-server.node.development.js:4004:27) at Object.<anonymous> (src/__tests__/functional-tests/ssr.test.ts:22:41)
(window as any).__awsuiDebug = { logs: [] };
}
(window as any).__awsuiDebug.logs.push('isVR: ' + isRefresh);

const isToolbar = useAppLayoutToolbarEnabled();
if (isRefresh) {
if (isToolbar) {
Expand Down

0 comments on commit 8c4a068

Please sign in to comment.