fixed existing task error reply
This commit is contained in:
parent
17637fe750
commit
b7909a3710
5 changed files with 28 additions and 11 deletions
12
index.html
12
index.html
|
|
@ -9,13 +9,13 @@
|
||||||
|
|
||||||
<script src="./auth.js"></script>
|
<script src="./auth.js"></script>
|
||||||
<script src="./configs.js"></script>
|
<script src="./configs.js"></script>
|
||||||
<script src="scripts/defaultConfigs.js"></script>
|
<script defer src="./scripts/defaultConfigs.js"></script>
|
||||||
<script defer src="scripts/functions.js"></script>
|
<script defer src="./scripts/functions.js"></script>
|
||||||
<script defer src="scripts/processCommand.js"></script>
|
<script defer src="./scripts/processCommand.js"></script>
|
||||||
<script defer src="scripts/index.js"></script>
|
<script defer src="./scripts/index.js"></script>
|
||||||
<script defer src="scripts/taskList.js"></script>
|
<script defer src="./scripts/taskList.js"></script>
|
||||||
|
|
||||||
<link rel="stylesheet" type="text/css" href="styles/taskList.css" />
|
<link rel="stylesheet" type="text/css" href="./styles/taskList.css" />
|
||||||
|
|
||||||
<title>Task List</title>
|
<title>Task List</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,12 @@ let params = {};
|
||||||
|
|
||||||
function respond(template, params) {
|
function respond(template, params) {
|
||||||
Object.keys(params).forEach((key) => {
|
Object.keys(params).forEach((key) => {
|
||||||
template = template.replace(`{${key}}`, params[key]);
|
console.log(`{${key}}: ${params[key]}`);
|
||||||
|
template = template.replaceAll(`{${key}}`, params[key]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log(template);
|
||||||
|
|
||||||
ComfyJS.Say(template);
|
ComfyJS.Say(template);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ async function processCommand(user, command, message, flags, extra) {
|
||||||
let addRequest = await addTask(user, extra.userColor, message);
|
let addRequest = await addTask(user, extra.userColor, message);
|
||||||
|
|
||||||
if (addRequest.status !== 200) {
|
if (addRequest.status !== 200) {
|
||||||
|
params.task = `${openQuote}${message}${closeQuote}`;
|
||||||
respond(addRequest.body.error, params);
|
respond(addRequest.body.error, params);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -25,7 +26,7 @@ async function processCommand(user, command, message, flags, extra) {
|
||||||
addedResponse += ` | Failed to add task(s): "${addRequest.body.tasksFailedToAdd}"`;
|
addedResponse += ` | Failed to add task(s): "${addRequest.body.tasksFailedToAdd}"`;
|
||||||
}
|
}
|
||||||
|
|
||||||
respond(addedResponse, params);
|
await respond(addedResponse, params);
|
||||||
} else if (getCommand("editTaskCommands").includes(command)) {
|
} else if (getCommand("editTaskCommands").includes(command)) {
|
||||||
let editRequest = await editTask(user, message);
|
let editRequest = await editTask(user, message);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -810,9 +810,9 @@ async function addTask(username, userColor, task) {
|
||||||
let addedTaskIndices = addTaskFunction.body.addedTaskIndices;
|
let addedTaskIndices = addTaskFunction.body.addedTaskIndices;
|
||||||
let tasksFailedToAdd = addTaskFunction.body.tasksFailedToAdd;
|
let tasksFailedToAdd = addTaskFunction.body.tasksFailedToAdd;
|
||||||
|
|
||||||
if (!scrolling) {
|
// if (!scrolling) {
|
||||||
await renderTaskListToDOM();
|
await renderTaskListToDOM();
|
||||||
}
|
// }
|
||||||
|
|
||||||
let displayedTasksAdded = addedTaskIndices.map((t) => {
|
let displayedTasksAdded = addedTaskIndices.map((t) => {
|
||||||
return `(${t.index + 1}) ${t.task}`;
|
return `(${t.index + 1}) ${t.task}`;
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,19 @@
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@keyframes scroll {
|
||||||
|
0% {
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: translateY(-100%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.primary, .secondary {
|
||||||
|
animation: scroll linear infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#main-container {
|
#main-container {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue