Skip to content

Commit

Permalink
Use win for accessing Scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
John Cowen committed Feb 1, 2021
1 parent ec2343f commit 50d7746
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ui/packages/consul-ui/app/utils/get-environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ export default function(config = {}, win = window, doc = document) {
.startsWith('CONSUL_')
);
};
window.Scenario = function(str = '') {
win.Scenario = function(str = '') {
if (str.length > 0) {
cookies(str).forEach(item => (doc.cookie = `${item};Path=/`));
win.location.hash = '';
location.reload();
} else {
str = cookies(doc.cookie).join(';');
const tab = window.open('', '_blank');
const tab = win.open('', '_blank');
tab.document.write(
`<body><pre>${location.href}#${str}</pre><br /><a href="javascript:Scenario('${str}')">Scenario</a></body>`
);
Expand All @@ -41,7 +41,7 @@ export default function(config = {}, win = window, doc = document) {
typeof win.location.hash === 'string' &&
win.location.hash.length > 0
) {
Scenario(win.location.hash.substr(1));
win.Scenario(win.location.hash.substr(1));
}
});
const dev = function(str = doc.cookie) {
Expand Down

0 comments on commit 50d7746

Please sign in to comment.