Use js-sdk imports for poll event types instead of events-sdk (#9904)
* Use js-sdk imports for poll event types instead of events-sdk * Attempt to appease some tsc --strict errors * Manually create poll response in cypress test
This commit is contained in:
parent
6052db1e8a
commit
badb2c4b27
23 changed files with 69 additions and 71 deletions
|
@ -17,14 +17,14 @@ limitations under the License.
|
|||
import React, { ChangeEvent, createRef } from "react";
|
||||
import { Room } from "matrix-js-sdk/src/models/room";
|
||||
import {
|
||||
IPartialEvent,
|
||||
KNOWN_POLL_KIND,
|
||||
KnownPollKind,
|
||||
M_POLL_KIND_DISCLOSED,
|
||||
M_POLL_KIND_UNDISCLOSED,
|
||||
M_POLL_START,
|
||||
PollStartEvent,
|
||||
} from "matrix-events-sdk";
|
||||
} from "matrix-js-sdk/src/@types/polls";
|
||||
import { PollStartEvent } from "matrix-js-sdk/src/extensible_events_v1/PollStartEvent";
|
||||
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
|
||||
import { IPartialEvent } from "matrix-js-sdk/src/@types/extensible_events";
|
||||
|
||||
import ScrollableBaseModal, { IScrollableBaseState } from "../dialogs/ScrollableBaseModal";
|
||||
import { IDialogProps } from "../dialogs/IDialogProps";
|
||||
|
@ -51,7 +51,7 @@ interface IState extends IScrollableBaseState {
|
|||
question: string;
|
||||
options: string[];
|
||||
busy: boolean;
|
||||
kind: KNOWN_POLL_KIND;
|
||||
kind: KnownPollKind;
|
||||
autoFocusTarget: FocusTarget;
|
||||
}
|
||||
|
||||
|
@ -263,7 +263,7 @@ export default class PollCreateDialog extends ScrollableBaseModal<IProps, IState
|
|||
};
|
||||
}
|
||||
|
||||
function pollTypeNotes(kind: KNOWN_POLL_KIND): string {
|
||||
function pollTypeNotes(kind: KnownPollKind): string {
|
||||
if (M_POLL_KIND_DISCLOSED.matches(kind.name)) {
|
||||
return _t("Voters see results as soon as they have voted");
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue