fix(basic.gblib): update ChatServices.ts #420

Closed
eltociear wants to merge 2540 commits from patch-1 into main
Showing only changes of commit 1e12c39acb - Show all commits

View file

@ -971,7 +971,7 @@ export class KBService implements IGBKBService {
for (const element of elements) { for (const element of elements) {
const src = await page.evaluate(el => el.getAttribute('src'), element); const src = await page.evaluate(el => el.getAttribute('src'), element);
if (src) { if (src) {
return src; return src.split('?')[0];
} }
} }
} }
@ -1029,7 +1029,8 @@ export class KBService implements IGBKBService {
let browser = await puppeteer.launch({ headless: false }); let browser = await puppeteer.launch({ headless: false });
const page = await this.getFreshPage(browser, website); const page = await this.getFreshPage(browser, website);
const logo = await this.getLogoByPage(page); let logo = await this.getLogoByPage(page);
if (logo){
path = DialogKeywords.getGBAIPath(min.botId); path = DialogKeywords.getGBAIPath(min.botId);
const logoPath = Path.join(process.env.PWD, 'work', path, 'cache'); const logoPath = Path.join(process.env.PWD, 'work', path, 'cache');
const baseUrl = page.url().split('/').slice(0, 3).join('/'); const baseUrl = page.url().split('/').slice(0, 3).join('/');
@ -1046,6 +1047,7 @@ export class KBService implements IGBKBService {
.toFile(Path.join(logoPath, logoFilename)); .toFile(Path.join(logoPath, logoFilename));
await min.core['setConfig'](min, 'Logo', logoFilename); await min.core['setConfig'](min, 'Logo', logoFilename);
}
// Extract dominant colors from the screenshot // Extract dominant colors from the screenshot