15 lines
398 B
TypeScript
15 lines
398 B
TypeScript
import type Config from '@typing/config';
|
|
import { codeListener, setUpMoodleGpt } from './core/code-listener';
|
|
|
|
chrome.storage.sync.get(['moodleGPT']).then(function (storage) {
|
|
const config: Config = storage.moodleGPT;
|
|
|
|
if (!config) throw new Error('Please configure MoodleGPT into the extension');
|
|
|
|
if (config.code) {
|
|
codeListener(config);
|
|
} else {
|
|
setUpMoodleGpt(config);
|
|
}
|
|
});
|