mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-26 21:53:06 +00:00
style: format OH7 files
This commit is contained in:
parent
8fd5838914
commit
c7a8dc7f64
3 changed files with 7 additions and 27 deletions
|
|
@ -93,15 +93,6 @@ const createEstimateOfflineExecutor = (): OfflineExecutor =>
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
/** Test/DI seam — reset module singletons between unit cases. */
|
|
||||||
export const resetOpsEstimateOutboxForTests = (): void => {
|
|
||||||
for (const key of [...opsEstimateOutboxCollection.keys()]) {
|
|
||||||
opsEstimateOutboxCollection.delete(key)
|
|
||||||
}
|
|
||||||
executorSingleton = null
|
|
||||||
initPromise = null
|
|
||||||
}
|
|
||||||
|
|
||||||
export const getOpsEstimateOfflineExecutor = async (): Promise<OfflineExecutor> => {
|
export const getOpsEstimateOfflineExecutor = async (): Promise<OfflineExecutor> => {
|
||||||
if (executorSingleton) {
|
if (executorSingleton) {
|
||||||
await executorSingleton.waitForInit()
|
await executorSingleton.waitForInit()
|
||||||
|
|
@ -131,15 +122,8 @@ export const enqueueEstimateVotes = async (input: EnqueueEstimateVotesInput): Pr
|
||||||
variables.baseEstimatedAt !== undefined
|
variables.baseEstimatedAt !== undefined
|
||||||
? variables.baseEstimatedAt
|
? variables.baseEstimatedAt
|
||||||
: (mirrorRow?.estimatedAt ?? null)
|
: (mirrorRow?.estimatedAt ?? null)
|
||||||
const next = toOpsEstimateOutboxRow(
|
const next = toOpsEstimateOutboxRow({ ...variables, baseEstimatedAt }, 'pending')
|
||||||
{ ...variables, baseEstimatedAt },
|
patchOpsVotePledgeEstimateOptimistic(next.pledgeId, next.estimatedVotes, next.estimateNote)
|
||||||
'pending',
|
|
||||||
)
|
|
||||||
patchOpsVotePledgeEstimateOptimistic(
|
|
||||||
next.pledgeId,
|
|
||||||
next.estimatedVotes,
|
|
||||||
next.estimateNote,
|
|
||||||
)
|
|
||||||
if (opsEstimateOutboxCollection.has(next.pledgeId)) {
|
if (opsEstimateOutboxCollection.has(next.pledgeId)) {
|
||||||
opsEstimateOutboxCollection.update(next.pledgeId, (draft) => {
|
opsEstimateOutboxCollection.update(next.pledgeId, (draft) => {
|
||||||
draft.estimatedVotes = next.estimatedVotes
|
draft.estimatedVotes = next.estimatedVotes
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,10 @@ import {
|
||||||
type OpsMirrorPersistenceMode,
|
type OpsMirrorPersistenceMode,
|
||||||
type OpsMirrorStore,
|
type OpsMirrorStore,
|
||||||
} from '@/components/campaign/opsSync/opsMirrorPersistence'
|
} from '@/components/campaign/opsSync/opsMirrorPersistence'
|
||||||
|
import {
|
||||||
|
mapVotePledgeWriteToOps,
|
||||||
|
type VotePledgeEstimateWriteResult,
|
||||||
|
} from '@/lib/campaignOps/mapVotePledgeWriteToOps'
|
||||||
import {
|
import {
|
||||||
createEmptyOpsSnapshot,
|
createEmptyOpsSnapshot,
|
||||||
type OpsActivity,
|
type OpsActivity,
|
||||||
|
|
@ -22,10 +26,6 @@ import {
|
||||||
type OpsStateDeputy,
|
type OpsStateDeputy,
|
||||||
type OpsVotePledge,
|
type OpsVotePledge,
|
||||||
} from '@/lib/campaignOps/opsContract'
|
} from '@/lib/campaignOps/opsContract'
|
||||||
import {
|
|
||||||
mapVotePledgeWriteToOps,
|
|
||||||
type VotePledgeEstimateWriteResult,
|
|
||||||
} from '@/lib/campaignOps/mapVotePledgeWriteToOps'
|
|
||||||
import { mergeOpsSnapshot } from '@/lib/campaignOps/opsMerge'
|
import { mergeOpsSnapshot } from '@/lib/campaignOps/opsMerge'
|
||||||
import { OPS_MIRROR_SCHEMA_VERSION } from '@/lib/campaignOps/opsMirrorVersion'
|
import { OPS_MIRROR_SCHEMA_VERSION } from '@/lib/campaignOps/opsMirrorVersion'
|
||||||
import type { OpsSyncState } from '@/lib/campaignOps/opsSyncMeta'
|
import type { OpsSyncState } from '@/lib/campaignOps/opsSyncMeta'
|
||||||
|
|
|
||||||
|
|
@ -106,11 +106,7 @@ export const PledgeEstimateForm = ({
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return <HybridPledgeEstimateForm pledgeID={pledgeID} />
|
||||||
<HybridPledgeEstimateForm
|
|
||||||
pledgeID={pledgeID}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const LegacyPledgeEstimateForm = ({
|
const LegacyPledgeEstimateForm = ({
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue