@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.
@@ -714,14 +714,20 @@ function createMockUserToken(token, projectId) {
714
714
  }
715
715
  const emulatorStatus = {};
716
716
  // Checks whether any products are running on an emulator
717
- function areRunningEmulator() {
718
- let runningEmulator = false;
717
+ function getEmulatorSummary() {
718
+ const summary = {
719
+ prod: [],
720
+ emulator: []
721
+ };
719
722
  for (const key of Object.keys(emulatorStatus)) {
720
723
  if (emulatorStatus[key]) {
721
- runningEmulator = true;
724
+ summary.emulator.push(key);
725
+ }
726
+ else {
727
+ summary.prod.push(key);
722
728
  }
723
729
  }
724
- return runningEmulator;
730
+ return summary;
725
731
  }
726
732
  function getOrCreateEl(id) {
727
733
  let parentDiv = document.getElementById(id);
@@ -747,10 +753,8 @@ function updateEmulatorBanner(name, isRunningEmulator) {
747
753
  }
748
754
  emulatorStatus[name] = isRunningEmulator;
749
755
  const bannerId = '__firebase__banner';
750
- if (!areRunningEmulator()) {
751
- tearDown();
752
- return;
753
- }
756
+ const summary = getEmulatorSummary();
757
+ const showError = summary.prod.length > 0;
754
758
  function tearDown() {
755
759
  const element = document.getElementById(bannerId);
756
760
  if (element) {
@@ -781,10 +785,16 @@ function updateEmulatorBanner(name, isRunningEmulator) {
781
785
  };
782
786
  bannerEl.appendChild(firebaseText);
783
787
  bannerEl.appendChild(closeBtn);
784
- document.body.appendChild(banner.element);
788
+ document.body.appendChild(bannerEl);
789
+ }
790
+ if (showError) {
791
+ banner.element.style.background = '#cd5c5c';
792
+ firebaseText.innerText = `Product${summary.prod.length > 0 ? 's' : ''} Running in Production: ${summary.prod.join(', ')}`;
793
+ }
794
+ else {
795
+ firebaseText.innerText = 'Running in this workspace';
785
796
  }
786
797
  firebaseText.setAttribute('id', '__firebase__text');
787
- firebaseText.innerText = 'Running in this workspace';
788
798
  }
789
799
  if (document.readyState === 'loading') {
790
800
  window.addEventListener('DOMContentLoaded', setupDom);