* feat(ui): rework for player look * remove unused code * move summary button and block inside xray * move class * fixup mobile controls panel * change notes, change xray feat selection
31 lines
614 B
TypeScript
31 lines
614 B
TypeScript
import { aiService } from 'App/services';
|
|
import { makeAutoObservable } from 'mobx';
|
|
|
|
export default class AiSummaryStore {
|
|
text = '';
|
|
toggleSummary = false;
|
|
|
|
constructor() {
|
|
makeAutoObservable(this);
|
|
}
|
|
|
|
setText(text: string) {
|
|
this.text = text;
|
|
}
|
|
|
|
setToggleSummary(toggleSummary: boolean) {
|
|
this.toggleSummary = toggleSummary;
|
|
}
|
|
|
|
getSummary = async (sessionId: string) => {
|
|
this.setText('');
|
|
try {
|
|
const respText = await aiService.getSummary(sessionId);
|
|
if (!respText) return;
|
|
|
|
this.setText(respText);
|
|
} catch (e) {
|
|
console.error(e);
|
|
}
|
|
};
|
|
}
|