Skip to content

Commit

Permalink
ReOpenIn Picker Panel functional
Browse files Browse the repository at this point in the history
  • Loading branch information
kendallcorner committed Feb 28, 2020
1 parent 1870ce0 commit d050701
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
1 change: 0 additions & 1 deletion src/js/pageAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ async function init() {
assignedUserContextId,
false
);
console.log(currentTab);
Utils.reloadInContainer(
currentTab.url,
false,
Expand Down
25 changes: 14 additions & 11 deletions src/js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -846,26 +846,29 @@ Logic.registerPanel(P_CONTAINER_PICKER, {
};
break;
case REOPEN_IN_CONTAINER:
pickedFunction = function (identity) {
try {
browser.tabs.create({
cookieStoreId: identity.cookieStoreId
});
window.close();
} catch (e) {
window.close();
}
pickedFunction = async function (identity) {
const currentTab = await Utils.currentTab();
const newUserContextId = Utils.userContextId(identity.cookieStoreId);
console.log(currentTab);
Utils.reloadInContainer(
currentTab.url,
false,
newUserContextId,
currentTab.index + 1,
currentTab.active
);
window.close();
};
break;
case ALWAYS_OPEN_IN_PICKER:
default:
pickedFunction = async function (identity) {
const userContextId = Utils.userContextId(identity.cookieStoreId);
const currentTab = await Utils.currentTab();
const assignedUserContextId = Utils.userContextId(identity.cookieStoreId);
Utils.setOrRemoveAssignment(
currentTab.id,
currentTab.url,
userContextId,
assignedUserContextId,
false
);
window.close();
Expand Down

0 comments on commit d050701

Please sign in to comment.