From a871d7d90eda9da18d446dc6967a69417e3e721f Mon Sep 17 00:00:00 2001 From: Lalit Date: Wed, 19 Jul 2023 20:48:24 +0530 Subject: [PATCH] poll_data: Revert to using "canned" instead of -1. We revert to using "canned" instead of -1 when populating `key_to_option` map so that it does not break for the old polls. --- web/shared/src/poll_data.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/shared/src/poll_data.ts b/web/shared/src/poll_data.ts index a788b14d7a..13568f188e 100644 --- a/web/shared/src/poll_data.ts +++ b/web/shared/src/poll_data.ts @@ -21,7 +21,7 @@ export type PollOptionData = { type PollOption = { option: string; - user_id: number; + user_id: number | string; votes: Map; }; @@ -40,7 +40,7 @@ export type PollHandle = { }; new_option: { outbound: (option: string) => {type: string; idx: number; option: string}; - inbound: (sender_id: number, data: InboundData) => void; + inbound: (sender_id: number | string, data: InboundData) => void; }; question: { outbound: (question: string) => {type: string; question: string} | undefined; @@ -238,7 +238,7 @@ export class PollData { }; for (const [i, option] of options.entries()) { - this.handle.new_option.inbound(-1, { + this.handle.new_option.inbound("canned", { idx: i, option, type: "new_option",