@firebase/util 1.11.0-firebase-studio-sdk-integration.bffdabd70 → 1.11.0-firebase-studio-sdk-integration.927daddb8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +20 -10
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm2017.js +20 -10
- package/dist/index.esm2017.js.map +1 -1
- package/dist/index.node.cjs.js +20 -10
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/node-esm/index.node.esm.js +20 -10
- package/dist/node-esm/index.node.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -718,14 +718,20 @@ function createMockUserToken(token, projectId) {
|
|
|
718
718
|
}
|
|
719
719
|
const emulatorStatus = {};
|
|
720
720
|
// Checks whether any products are running on an emulator
|
|
721
|
-
function
|
|
722
|
-
|
|
721
|
+
function getEmulatorSummary() {
|
|
722
|
+
const summary = {
|
|
723
|
+
prod: [],
|
|
724
|
+
emulator: []
|
|
725
|
+
};
|
|
723
726
|
for (const key of Object.keys(emulatorStatus)) {
|
|
724
727
|
if (emulatorStatus[key]) {
|
|
725
|
-
|
|
728
|
+
summary.emulator.push(key);
|
|
729
|
+
}
|
|
730
|
+
else {
|
|
731
|
+
summary.prod.push(key);
|
|
726
732
|
}
|
|
727
733
|
}
|
|
728
|
-
return
|
|
734
|
+
return summary;
|
|
729
735
|
}
|
|
730
736
|
function getOrCreateEl(id) {
|
|
731
737
|
let parentDiv = document.getElementById(id);
|
|
@@ -751,10 +757,8 @@ function updateEmulatorBanner(name, isRunningEmulator) {
|
|
|
751
757
|
}
|
|
752
758
|
emulatorStatus[name] = isRunningEmulator;
|
|
753
759
|
const bannerId = '__firebase__banner';
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
return;
|
|
757
|
-
}
|
|
760
|
+
const summary = getEmulatorSummary();
|
|
761
|
+
const showError = summary.prod.length > 0;
|
|
758
762
|
function tearDown() {
|
|
759
763
|
const element = document.getElementById(bannerId);
|
|
760
764
|
if (element) {
|
|
@@ -785,10 +789,16 @@ function updateEmulatorBanner(name, isRunningEmulator) {
|
|
|
785
789
|
};
|
|
786
790
|
bannerEl.appendChild(firebaseText);
|
|
787
791
|
bannerEl.appendChild(closeBtn);
|
|
788
|
-
document.body.appendChild(
|
|
792
|
+
document.body.appendChild(bannerEl);
|
|
793
|
+
}
|
|
794
|
+
if (showError) {
|
|
795
|
+
banner.element.style.background = '#cd5c5c';
|
|
796
|
+
firebaseText.innerText = `Product${summary.prod.length > 0 ? 's' : ''} Running in Production: ${summary.prod.join(', ')}`;
|
|
797
|
+
}
|
|
798
|
+
else {
|
|
799
|
+
firebaseText.innerText = 'Running in this workspace';
|
|
789
800
|
}
|
|
790
801
|
firebaseText.setAttribute('id', '__firebase__text');
|
|
791
|
-
firebaseText.innerText = 'Running in this workspace';
|
|
792
802
|
}
|
|
793
803
|
if (document.readyState === 'loading') {
|
|
794
804
|
window.addEventListener('DOMContentLoaded', setupDom);
|