move getUserInfo define to util.js
This commit is contained in:
15
globals.js
15
globals.js
@@ -14,21 +14,6 @@ if (typeof window.globalsLoaded === "undefined") {
|
||||
|
||||
const CHECKBOX_CLASS = "conversation-checkbox";
|
||||
|
||||
// Define getUserInfo function
|
||||
function getUserInfo() {
|
||||
return new Promise((resolve, reject) => {
|
||||
chrome.runtime.sendMessage({ action: "getUserInfo" }, (response) => {
|
||||
if (chrome.runtime.lastError) {
|
||||
reject(chrome.runtime.lastError);
|
||||
} else if (response.error) {
|
||||
reject(new Error(response.error));
|
||||
} else {
|
||||
resolve(response.userInfo);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Expose variables to the global scope
|
||||
window.Selectors = Selectors;
|
||||
window.shiftPressed = false;
|
||||
|
||||
Reference in New Issue
Block a user