Skip to content

Commit

Permalink
fix: Do not use Flow namespace for information not related to Flow (#…
Browse files Browse the repository at this point in the history
…11678) (#11687)

Fixes #9905 again. It was re-introduced in #11669

Co-authored-by: Artur <artur@vaadin.com>
  • Loading branch information
vaadin-bot and Artur- committed Aug 30, 2021
1 parent 339d2d5 commit b5c7cb1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ const injectGlobalCssMethod = `
export const injectGlobalCss = (css, target, first) => {
if(target === document) {
const hash = getHash(css);
if (window.Vaadin.Flow.injectedGlobalCss.indexOf(hash) !== -1) {
if (window.Vaadin.theme.injectedGlobalCss.indexOf(hash) !== -1) {
return;
}
window.Vaadin.Flow.injectedGlobalCss.push(hash);
window.Vaadin.theme.injectedGlobalCss.push(hash);
}
const sheet = new CSSStyleSheet();
sheet.replaceSync(createLinkReferences(css,target));
Expand Down Expand Up @@ -260,8 +260,8 @@ function generateThemeFile(themeFolder, themeName, themeProperties, productionMo
themeFile += imports.join('');
themeFile += `
window.Vaadin = window.Vaadin || {};
window.Vaadin.Flow = window.Vaadin.Flow || {};
window.Vaadin.Flow.injectedGlobalCss = [];
window.Vaadin.theme = window.Vaadin.theme || {};
window.Vaadin.theme.injectedGlobalCss = [];
/**
* Calculate a 32 bit FNV-1a hash
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,6 @@ public void multipleSameEmbedded_cssTargetingDocumentShouldOnlyAddElementsOneTim
Assert.assertEquals(
"Project contains 2 css injections to document and both should be hashed",
2l, getCommandExecutor().executeScript(
"return window.Vaadin.Flow.injectedGlobalCss.length"));
"return window.Vaadin.theme.injectedGlobalCss.length"));
}
}

0 comments on commit b5c7cb1

Please sign in to comment.