The code is not required anymore
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -2,11 +2,13 @@ import Config from "../types/config";
|
||||
import titleIndications from "../utils/title-indications";
|
||||
import reply from "./reply";
|
||||
|
||||
const pressedKeys: string[] = [];
|
||||
const listeners: {
|
||||
type Listener = {
|
||||
element: HTMLElement;
|
||||
fn: (this: HTMLElement, ev: MouseEvent) => any;
|
||||
}[] = [];
|
||||
};
|
||||
|
||||
const pressedKeys: string[] = [];
|
||||
const listeners: Listener[] = [];
|
||||
|
||||
/**
|
||||
* Create a listener on the keyboard to inject the code
|
||||
@@ -80,4 +82,4 @@ function removeListener(element: HTMLElement) {
|
||||
}
|
||||
}
|
||||
|
||||
export { codeListener, removeListener };
|
||||
export { codeListener, removeListener, setUpMoodleGpt };
|
||||
|
||||
+8
-3
@@ -1,9 +1,14 @@
|
||||
import { codeListener } from "./core/code-listener";
|
||||
import { codeListener, setUpMoodleGpt } from "./core/code-listener";
|
||||
import type Config from "./types/config";
|
||||
|
||||
chrome.storage.sync.get(["moodleGPT"]).then(function (storage) {
|
||||
const config = storage.moodleGPT;
|
||||
const config: Config = storage.moodleGPT;
|
||||
|
||||
if (!config) throw new Error("Please configure MoodleGPT into the extension");
|
||||
|
||||
codeListener(config);
|
||||
if (config.code) {
|
||||
codeListener(config);
|
||||
} else {
|
||||
setUpMoodleGpt(config);
|
||||
}
|
||||
});
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
type Config = {
|
||||
apiKey: string;
|
||||
code: string;
|
||||
code?: string;
|
||||
model?: string;
|
||||
infinite?: boolean;
|
||||
typing?: boolean;
|
||||
|
||||
Reference in New Issue
Block a user