import { createUIStore } from 'redux-webext';
import addEventListeners from './event-listeners';
import { populateTabList } from './dom-utils';

// Initialize tabs
createUIStore()
  .then(populateTabList)
  .then(addEventListeners)
  .catch((e) => {
    console.error(e);
    throw new Error(e);
  });

@@ -1,16 +1,43 @@
+/* Popup initialization */%0A
 import %7B createU
@@ -172,38 +172,473 @@
 %0A// 
-Initialize tabs%0AcreateUIStore(
+Add a key containing adding the current windowId to the popup.%0Aconst windowIdPromise = browser.windows.getCurrent()%0A  .then((%7B id %7D) =%3E (%7B windowId: id %7D));%0A// Adds a key 'windowId' to the store object.%0A// Store object is now -%3E %7B dispatch, getState, subscribe, windowId %7D%0Aconst mergeStoreWithWindowId = promiseArray =%3E%0A  promiseArray.reduce((acc, obj) =%3E Object.assign(%7B%7D, acc, obj));%0A%0APromise.all(%5BcreateUIStore(), windowIdPromise%5D)%0A  .then(mergeStoreWithWindowId
 )%0A  
@@ -743,22 +743,68 @@
 w new Error(
-e
+'Ran into a problem initializing popup window.'
 );%0A  %7D);%0A

Add windowId to store object on popup init