From af08fdaa8b7267c5e8fcfb7b3ac946f5fb3f8076 Mon Sep 17 00:00:00 2001 From: Yvv Date: Tue, 3 Nov 2026 07:43:51 +0100 Subject: [PATCH] =?UTF-8?q?Lot=20U=20:=20apr=C3=A8s=20la=20fusion,=20les?= =?UTF-8?q?=20contrats=20r=C3=A9els=20de=20S=20et=20V=20remplacent=20les?= =?UTF-8?q?=20champs=20annonc=C3=A9s=20;=20canCast=20et=20byChain=20retir?= =?UTF-8?q?=C3=A9s=20(le=20serveur=20dit=20open=20et=20way)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- web/src/lib/types.ts | 17 ----------------- web/src/lib/vote.ts | 15 +-------------- 2 files changed, 1 insertion(+), 31 deletions(-) diff --git a/web/src/lib/types.ts b/web/src/lib/types.ts index dcc8866..6f5def8 100644 --- a/web/src/lib/types.ts +++ b/web/src/lib/types.ts @@ -148,18 +148,6 @@ export interface Proposal { translations: Partial>; /** An order version: the order it gives its section now. */ order?: OrderInfo; - /** - * Lot S: a « Proposition seed », proposed at the start to set the vote going — not in - * force. Absent before lot S: read as false. - */ - seedProposal?: boolean; - /** - * Lot V: where this session's vote stands — recorded, waiting (the chain, the buffer of - * intentions), or simulated while the chain is closed. Absent before lot V. - */ - myVoteState?: 'recorded' | 'pending' | 'simulated' | null; - /** Lot V: votes cast and not counted yet (the buffer of intentions). */ - tallyPending?: Tally; } export type Choice = 'for' | 'against' | 'none'; @@ -195,11 +183,6 @@ export interface VoteAccess { simulated: boolean; reason: 'members_only' | 'chain_off' | null; chain: ChainSettings | null; - /** - * Lot V: the vote is simulated while the chain is closed — the buttons show as if it - * were open, marked « vote simulé ». Absent before lot V. - */ - simulated?: true; } /** A ballot of the chain, as `GET /api/ballots/{id}` tells it to the session that asked. */ diff --git a/web/src/lib/vote.ts b/web/src/lib/vote.ts index b1316ed..46acd81 100644 --- a/web/src/lib/vote.ts +++ b/web/src/lib/vote.ts @@ -6,7 +6,7 @@ import type { DocState } from './doc.svelte'; import { i18n, t, type Key } from './i18n/index.svelte'; import { toasts } from './toast.svelte'; import { moduleName, sectionLabel } from './labels'; -import type { Entered, VoteAccess } from './types'; +import type { Entered } from './types'; /** A line of a vote: one version, for or against, or null to withdraw one's vote. */ export interface Line { @@ -14,19 +14,6 @@ export interface Line { choice: 'for' | 'against' | null; } -/** - * Whether this session sees the buttons of the vote: open, or simulated while the chain is - * closed (lot V: « les boutons de vote apparaissent partout comme si le vote était ouvert »). - */ -export function canCast(access: VoteAccess | null | undefined): boolean { - return !!access && (access.open || access.simulated === true); -} - -/** A vote that goes through the person's Ğ1 wallet; a simulated vote never does. */ -export function byChain(access: VoteAccess | null | undefined): boolean { - return access?.way === 'chain' && access.simulated !== true && !!access.chain; -} - /** Cents of Ğ1, as the person reads them: « 0,1 » in French. */ export function g1Amount(cents: number): string { return i18n.number(cents / 100);