🚨 Lint
This commit is contained in:
@@ -121,4 +121,4 @@ export const commonHeaders = [
|
||||
"X-Requested-With",
|
||||
"X-Robots-Tag",
|
||||
"X-UA-Compatible"
|
||||
]
|
||||
];
|
||||
|
||||
@@ -5,16 +5,19 @@ const EXTENSION_ID = "amknoiejhlmhancpahfcfcfhllgkpbld";
|
||||
// Also check for the presence of window.chrome object to confirm smooth operations
|
||||
export const hasChromeExtensionInstalled = () => {
|
||||
return document.getElementById("chromePWExtensionDetect") !== null;
|
||||
}
|
||||
};
|
||||
|
||||
const chromeWithoutProxy = (req, _store) => new Promise((resolve, reject) => {
|
||||
const chromeWithoutProxy = (req, _store) =>
|
||||
new Promise((resolve, reject) => {
|
||||
chrome.runtime.sendMessage(
|
||||
EXTENSION_ID, {
|
||||
EXTENSION_ID,
|
||||
{
|
||||
messageType: "send-req",
|
||||
data: {
|
||||
config: req
|
||||
}
|
||||
}, (message) => {
|
||||
},
|
||||
message => {
|
||||
if (message.data.error) {
|
||||
reject(message.data.error);
|
||||
} else {
|
||||
@@ -22,28 +25,33 @@ const chromeWithoutProxy = (req, _store) => new Promise((resolve, reject) => {
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
const chromeWithProxy = (req, { state }) => new Promise((resolve, reject) => {
|
||||
const chromeWithProxy = (req, { state }) =>
|
||||
new Promise((resolve, reject) => {
|
||||
chrome.runtime.sendMessage(
|
||||
EXTENSION_ID, {
|
||||
EXTENSION_ID,
|
||||
{
|
||||
messageType: "send-req",
|
||||
data: {
|
||||
config: {
|
||||
method: "post",
|
||||
url: state.postwoman.settings.PROXY_URL || "https://postwoman.apollotv.xyz/",
|
||||
url:
|
||||
state.postwoman.settings.PROXY_URL ||
|
||||
"https://postwoman.apollotv.xyz/",
|
||||
data: req
|
||||
}
|
||||
}
|
||||
}, (message) => {
|
||||
},
|
||||
message => {
|
||||
if (message.data.error) {
|
||||
reject(error);
|
||||
} else {
|
||||
resolve(message.data.response.data);
|
||||
}
|
||||
}
|
||||
)
|
||||
});
|
||||
);
|
||||
});
|
||||
|
||||
const chromeStrategy = (req, store) => {
|
||||
if (store.state.postwoman.settings.PROXY_ENABLED) {
|
||||
@@ -51,6 +59,6 @@ const chromeStrategy = (req, store) => {
|
||||
} else {
|
||||
return chromeWithoutProxy(req, store);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default chromeStrategy;
|
||||
|
||||
@@ -118,7 +118,9 @@ export const mutations = {
|
||||
|
||||
addNewCollection({ collections }, collection) {
|
||||
const { name } = collection;
|
||||
const duplicateCollection = collections.some(item => item.name.toLowerCase() === name.toLowerCase());
|
||||
const duplicateCollection = collections.some(
|
||||
item => item.name.toLowerCase() === name.toLowerCase()
|
||||
);
|
||||
if (duplicateCollection) {
|
||||
this.$toast.info("Duplicate collection");
|
||||
return;
|
||||
@@ -139,7 +141,9 @@ export const mutations = {
|
||||
editCollection({ collections }, payload) {
|
||||
const { collection, collectionIndex } = payload;
|
||||
const { name } = collection;
|
||||
const duplicateCollection = collections.some(item => item.name.toLowerCase() === name.toLowerCase());
|
||||
const duplicateCollection = collections.some(
|
||||
item => item.name.toLowerCase() === name.toLowerCase()
|
||||
);
|
||||
if (duplicateCollection) {
|
||||
this.$toast.info("Duplicate collection");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user