1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-08-09 08:42:50 +03:00

Apply prettier formatting

This commit is contained in:
Michael Weimann
2022-12-12 12:24:14 +01:00
parent 1cac306093
commit 526645c791
1576 changed files with 65385 additions and 62478 deletions

View File

@@ -17,34 +17,28 @@ limitations under the License.
import { MatrixEvent } from "matrix-js-sdk/src/matrix";
import { M_TEXT, M_POLL_START, POLL_ANSWER, M_POLL_KIND_DISCLOSED } from "matrix-events-sdk";
export const makePollStartEvent = (
question: string,
sender: string,
answers?: POLL_ANSWER[],
): MatrixEvent => {
export const makePollStartEvent = (question: string, sender: string, answers?: POLL_ANSWER[]): MatrixEvent => {
if (!answers) {
answers = [
{ "id": "socks", [M_TEXT.name]: "Socks" },
{ "id": "shoes", [M_TEXT.name]: "Shoes" },
{ id: "socks", [M_TEXT.name]: "Socks" },
{ id: "shoes", [M_TEXT.name]: "Shoes" },
];
}
return new MatrixEvent(
{
"event_id": "$mypoll",
"room_id": "#myroom:example.com",
"sender": sender,
"type": M_POLL_START.name,
"content": {
[M_POLL_START.name]: {
"question": {
[M_TEXT.name]: question,
},
"kind": M_POLL_KIND_DISCLOSED.name,
"answers": answers,
return new MatrixEvent({
event_id: "$mypoll",
room_id: "#myroom:example.com",
sender: sender,
type: M_POLL_START.name,
content: {
[M_POLL_START.name]: {
question: {
[M_TEXT.name]: question,
},
[M_TEXT.name]: `${question}: answers`,
kind: M_POLL_KIND_DISCLOSED.name,
answers: answers,
},
[M_TEXT.name]: `${question}: answers`,
},
);
});
};