|
@ -20,18 +20,18 @@ import type { TaskResult } from "../models/task"; |
|
|
if (mode === "item") { |
|
|
if (mode === "item") { |
|
|
for (const log of logs) { |
|
|
for (const log of logs) { |
|
|
const item = log.item; |
|
|
const item = log.item; |
|
|
if (!map[item.name]) { |
|
|
|
|
|
map[item.name] = {name: item.name, amount: log.itemAmount, link: `/items#${item.id}`}; |
|
|
|
|
|
|
|
|
if (!map[item.id]) { |
|
|
|
|
|
map[item.id] = {name: item.name, amount: log.itemAmount, link: `/items#${item.id}`}; |
|
|
} else { |
|
|
} else { |
|
|
map[item.name].amount += log.itemAmount; |
|
|
|
|
|
|
|
|
map[item.id].amount += log.itemAmount; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (log.secondaryItem) { |
|
|
if (log.secondaryItem) { |
|
|
const item = log.secondaryItem; |
|
|
const item = log.secondaryItem; |
|
|
if (!map[item.name]) { |
|
|
|
|
|
map[item.name] = {name: item.name, amount: log.secondaryItemAmount, link: `/items#${item.id}`}; |
|
|
|
|
|
|
|
|
if (!map[item.id]) { |
|
|
|
|
|
map[item.id] = {name: item.name, amount: log.secondaryItemAmount, link: `/items#${item.id}`}; |
|
|
} else { |
|
|
} else { |
|
|
map[item.name].amount += log.secondaryItemAmount; |
|
|
|
|
|
|
|
|
map[item.id].amount += log.secondaryItemAmount; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -41,10 +41,10 @@ import type { TaskResult } from "../models/task"; |
|
|
|
|
|
|
|
|
const amount = log.secondaryItem ? log.secondaryItemAmount + log.itemAmount : log.itemAmount; |
|
|
const amount = log.secondaryItem ? log.secondaryItemAmount + log.itemAmount : log.itemAmount; |
|
|
|
|
|
|
|
|
if (!map[task.name]) { |
|
|
|
|
|
map[task.name] = {name: task.name, amount, link: `/questlog#${task.projectId}`}; |
|
|
|
|
|
|
|
|
if (!map[task.id]) { |
|
|
|
|
|
map[task.id] = {name: task.name, amount, link: `/questlog#${task.projectId}`}; |
|
|
} else { |
|
|
} else { |
|
|
map[task.name].amount += amount; |
|
|
|
|
|
|
|
|
map[task.id].amount += amount; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|