Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
load = async () => {
try {
if (process.env.NODE_ENV !== 'development') {
this.config = await request.get(`${config.resourceHost}/config.json`);
}
runInAction(() => {
this.isLatestVersion = !hasUpdate(this.config.chromeWebStoreVersion, this.localVersion);
});
const iconsFile = await request.get(this.config.iconfont);
const matchResult: string[] = iconsFile.match(/id="([A-Za-z]+)"/g) || [];
const remoteIcons = matchResult.map(o => o.match(/id="([A-Za-z]+)"/)![1]);
runInAction(() => {
remoteIcons.forEach(icon => {
this.remoteIconSet.add(icon);
});
});
} catch (_error) {
console.log('Load Config Error');
}
};
load = async () => {
try {
if (process.env.NODE_ENV !== 'development') {
this.config = await request.get(`${config.resourceHost}/config.json`);
}
runInAction(() => {
this.isLatestVersion = !hasUpdate(this.config.chromeWebStoreVersion, this.localVersion);
});
const iconsFile = await request.get(this.config.iconfont);
const matchResult: string[] = iconsFile.match(/id="([A-Za-z]+)"/g) || [];
const remoteIcons = matchResult.map(o => o.match(/id="([A-Za-z]+)"/)![1]);
runInAction(() => {
remoteIcons.forEach(icon => {
this.remoteIconSet.add(icon);
});
});
} catch (_error) {
console.log('Load Config Error');
}
};
() => request.get(`${config.resourceHost}/changelog/CHANGELOG.${workLocale}.md`),
[]
() => request.get(`${config.resourceHost}/privacy/PRIVACY.${workLocale}.md`),
[]