added multiple tokens catch
This commit is contained in:
+10
-3
@@ -527,7 +527,7 @@
|
||||
</script>
|
||||
</body>
|
||||
<script>
|
||||
/** @param {{error?: string; password: string; data: {name: string; url: string; comment: string; token: string | null}[] }} data */
|
||||
/** @param {{error?: string; password: string; data: {name: string; url: string; comment: string; tokens: string[]}[] }} data */
|
||||
const appendData = (data) => {
|
||||
if (data.error) {
|
||||
document.querySelector("[k-m-error]").innerHTML = renderTemplate(
|
||||
@@ -543,8 +543,15 @@
|
||||
let completedBlocks = [];
|
||||
let activeBlocks = [];
|
||||
data.data.forEach((item) => {
|
||||
if (!!item.token) {
|
||||
completedBlocks.push(renderTemplate("complete_row", item));
|
||||
if (item.tokens.length > 0) {
|
||||
item.tokens.forEach(token => {
|
||||
completedBlocks.push(renderTemplate("complete_row", {
|
||||
name: item.name,
|
||||
url: item.url,
|
||||
comment: item.comment,
|
||||
token
|
||||
}));
|
||||
});
|
||||
} else {
|
||||
activeBlocks.push(
|
||||
renderTemplate("active_row", {
|
||||
|
||||
Reference in New Issue
Block a user