integrated front and back

This commit is contained in:
2026-10-01 23:52:12 +03:00
parent 1f81632083
commit 3e966c9ff6
15 changed files with 634 additions and 72 deletions
+13
View File
@@ -1,10 +1,23 @@
import { state, saveState, genId } from '../state.js';
import { renderMainScreen } from '../render/main-screen.js';
import { showEditWorkoutDateDialog } from '../modals/edit-workout-date-modal.js';
import { showClientSelectModal } from '../modals/client-select-modal.js';
export function startWorkout() {
// В режиме тренера — сначала выбираем клиента
if (state.mode === 'trainer') {
showClientSelectModal((clientId) => {
_createWorkout(clientId);
});
} else {
_createWorkout(null);
}
}
function _createWorkout(clientId) {
const w = {
id: genId(),
client_id: clientId,
startTime: new Date().toISOString(),
endTime: null,
type: '',