mirror of https://github.com/zulip/zulip.git
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.
This commit is contained in:
parent
072a62d5b5
commit
a871d7d90e
|
@ -21,7 +21,7 @@ export type PollOptionData = {
|
|||
|
||||
type PollOption = {
|
||||
option: string;
|
||||
user_id: number;
|
||||
user_id: number | string;
|
||||
votes: Map<number, number>;
|
||||
};
|
||||
|
||||
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue