INNER CODE UNIT · TypeScript

analysisView

gbtami/pychess-variants · client/analysis/index.ts:258

export function analysisView(model: PyChessModel): VNode[] {
    const context = analysisContext(model);
    const isOngoingGame = model.status == -1;
    let ctrl: AnalysisController | undefined;
    renderTimeago();

    const addToStudy = async () => {
        const tree = ctrl?.analysisTree;
        if (!ctrl || !tree) return;
        try {
            const defaultChapterName =
                model.gameId && model.wplayer && model.bplayer ? `${model.wplayer} - ${model.bplayer}` : _('Analysis');
            const destination = await chooseStudy(defaultChapterName);
            if (!destination) return;
            const tags = studyTagsFromAnalysis(model, ctrl);
            const response = await fetch('/study/from-analysis', {
                method: 'POST',
                headers: { 'Content-Type': 'application/json' },

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…