mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-12-26 09:59:21 +08:00
removing custom text from the hash
This commit is contained in:
parent
de636ffc21
commit
3b01cd4f19
2 changed files with 5 additions and 2 deletions
|
|
@ -75,6 +75,7 @@ class ResultController {
|
|||
const resulthash = result.hash;
|
||||
delete result.hash;
|
||||
delete result.strigified;
|
||||
delete result.customText;
|
||||
if (
|
||||
req.ctx.configuration.resultObjectHashCheck.enabled &&
|
||||
resulthash.length === 64
|
||||
|
|
|
|||
|
|
@ -1071,7 +1071,7 @@ export async function addWord(): Promise<void> {
|
|||
interface CompletedEvent extends MonkeyTypes.Result<MonkeyTypes.Mode> {
|
||||
keySpacing: number[] | "toolong";
|
||||
keyDuration: number[] | "toolong";
|
||||
customText: MonkeyTypes.CustomText;
|
||||
customText?: MonkeyTypes.CustomText;
|
||||
smoothConsistency: number;
|
||||
wpmConsistency: number;
|
||||
lang: string;
|
||||
|
|
@ -1500,7 +1500,9 @@ export async function finish(difficultyFailed = false): Promise<void> {
|
|||
AccountButton.loading(true);
|
||||
completedEvent.challenge = ChallengeContoller.verify(completedEvent);
|
||||
if (completedEvent.challenge === null) delete completedEvent?.challenge;
|
||||
completedEvent.hash = objecthash(completedEvent);
|
||||
const toHash = Object.assign({}, completedEvent);
|
||||
delete toHash.customText;
|
||||
completedEvent.hash = objecthash(toHash);
|
||||
|
||||
const response = await Ape.results.save(completedEvent);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue