mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 20:31:37 -05:00
Fix TypeError
This commit is contained in:
@@ -229,7 +229,7 @@ const ModelInfoView = ({ modelInfo }: { modelInfo: ModelInfo }) => {
|
|||||||
doesNotSupportLabel="Does not support prompt caching"
|
doesNotSupportLabel="Does not support prompt caching"
|
||||||
/>
|
/>
|
||||||
<br />
|
<br />
|
||||||
<span style={{ fontWeight: 500 }}>Max output:</span> {modelInfo.maxTokens.toLocaleString()} tokens
|
<span style={{ fontWeight: 500 }}>Max output:</span> {modelInfo?.maxTokens?.toLocaleString()} tokens
|
||||||
<br />
|
<br />
|
||||||
<span style={{ fontWeight: 500 }}>Input price:</span> {formatPrice(modelInfo.inputPrice)}/million tokens
|
<span style={{ fontWeight: 500 }}>Input price:</span> {formatPrice(modelInfo.inputPrice)}/million tokens
|
||||||
{modelInfo.supportsPromptCache && modelInfo.cacheWritesPrice && modelInfo.cacheReadsPrice && (
|
{modelInfo.supportsPromptCache && modelInfo.cacheWritesPrice && modelInfo.cacheReadsPrice && (
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ const HistoryPreview = ({ taskHistory, showHistoryView }: HistoryPreviewProps) =
|
|||||||
const formatDate = (timestamp: number) => {
|
const formatDate = (timestamp: number) => {
|
||||||
const date = new Date(timestamp)
|
const date = new Date(timestamp)
|
||||||
return date
|
return date
|
||||||
.toLocaleString("en-US", {
|
?.toLocaleString("en-US", {
|
||||||
month: "long",
|
month: "long",
|
||||||
day: "numeric",
|
day: "numeric",
|
||||||
hour: "numeric",
|
hour: "numeric",
|
||||||
@@ -100,14 +100,14 @@ const HistoryPreview = ({ taskHistory, showHistoryView }: HistoryPreviewProps) =
|
|||||||
</div>
|
</div>
|
||||||
<div style={{ fontSize: "0.85em", color: "var(--vscode-descriptionForeground)" }}>
|
<div style={{ fontSize: "0.85em", color: "var(--vscode-descriptionForeground)" }}>
|
||||||
<span>
|
<span>
|
||||||
Tokens: ↑{item.tokensIn.toLocaleString()} ↓{item.tokensOut.toLocaleString()}
|
Tokens: ↑{item.tokensIn?.toLocaleString()} ↓{item.tokensOut?.toLocaleString()}
|
||||||
</span>
|
</span>
|
||||||
{" • "}
|
{" • "}
|
||||||
{item.cacheWrites && item.cacheReads && (
|
{item.cacheWrites && item.cacheReads && (
|
||||||
<>
|
<>
|
||||||
<span>
|
<span>
|
||||||
Cache: +{item.cacheWrites.toLocaleString()} →{" "}
|
Cache: +{item.cacheWrites?.toLocaleString()} →{" "}
|
||||||
{item.cacheReads.toLocaleString()}
|
{item.cacheReads?.toLocaleString()}
|
||||||
</span>
|
</span>
|
||||||
{" • "}
|
{" • "}
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ const HistoryView = ({ taskHistory, onDone }: HistoryViewProps) => {
|
|||||||
const formatDate = (timestamp: number) => {
|
const formatDate = (timestamp: number) => {
|
||||||
const date = new Date(timestamp)
|
const date = new Date(timestamp)
|
||||||
return date
|
return date
|
||||||
.toLocaleString("en-US", {
|
?.toLocaleString("en-US", {
|
||||||
month: "long",
|
month: "long",
|
||||||
day: "numeric",
|
day: "numeric",
|
||||||
hour: "numeric",
|
hour: "numeric",
|
||||||
@@ -185,7 +185,7 @@ const HistoryView = ({ taskHistory, onDone }: HistoryViewProps) => {
|
|||||||
marginBottom: "-2px",
|
marginBottom: "-2px",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{item.tokensIn.toLocaleString()}
|
{item.tokensIn?.toLocaleString()}
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
style={{
|
style={{
|
||||||
@@ -202,7 +202,7 @@ const HistoryView = ({ taskHistory, onDone }: HistoryViewProps) => {
|
|||||||
marginBottom: "-2px",
|
marginBottom: "-2px",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{item.tokensOut.toLocaleString()}
|
{item.tokensOut?.toLocaleString()}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
{item.cacheWrites && item.cacheReads && (
|
{item.cacheWrites && item.cacheReads && (
|
||||||
@@ -235,7 +235,7 @@ const HistoryView = ({ taskHistory, onDone }: HistoryViewProps) => {
|
|||||||
marginBottom: "-1px",
|
marginBottom: "-1px",
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
+{item.cacheWrites.toLocaleString()}
|
+{item.cacheWrites?.toLocaleString()}
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
style={{
|
style={{
|
||||||
@@ -248,7 +248,7 @@ const HistoryView = ({ taskHistory, onDone }: HistoryViewProps) => {
|
|||||||
className="codicon codicon-arrow-right"
|
className="codicon codicon-arrow-right"
|
||||||
style={{ fontSize: "12px", fontWeight: "bold", marginBottom: 0 }}
|
style={{ fontSize: "12px", fontWeight: "bold", marginBottom: 0 }}
|
||||||
/>
|
/>
|
||||||
{item.cacheReads.toLocaleString()}
|
{item.cacheReads?.toLocaleString()}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -197,14 +197,14 @@ const TaskHeader: React.FC<TaskHeaderProps> = ({
|
|||||||
className="codicon codicon-arrow-up"
|
className="codicon codicon-arrow-up"
|
||||||
style={{ fontSize: "12px", fontWeight: "bold", marginBottom: "-2px" }}
|
style={{ fontSize: "12px", fontWeight: "bold", marginBottom: "-2px" }}
|
||||||
/>
|
/>
|
||||||
{tokensIn.toLocaleString()}
|
{tokensIn?.toLocaleString()}
|
||||||
</span>
|
</span>
|
||||||
<span style={{ display: "flex", alignItems: "center", gap: "3px" }}>
|
<span style={{ display: "flex", alignItems: "center", gap: "3px" }}>
|
||||||
<i
|
<i
|
||||||
className="codicon codicon-arrow-down"
|
className="codicon codicon-arrow-down"
|
||||||
style={{ fontSize: "12px", fontWeight: "bold", marginBottom: "-2px" }}
|
style={{ fontSize: "12px", fontWeight: "bold", marginBottom: "-2px" }}
|
||||||
/>
|
/>
|
||||||
{tokensOut.toLocaleString()}
|
{tokensOut?.toLocaleString()}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
{(doesModelSupportPromptCache || cacheReads !== undefined || cacheWrites !== undefined) && (
|
{(doesModelSupportPromptCache || cacheReads !== undefined || cacheWrites !== undefined) && (
|
||||||
@@ -215,14 +215,14 @@ const TaskHeader: React.FC<TaskHeaderProps> = ({
|
|||||||
className="codicon codicon-database"
|
className="codicon codicon-database"
|
||||||
style={{ fontSize: "12px", fontWeight: "bold", marginBottom: "-1px" }}
|
style={{ fontSize: "12px", fontWeight: "bold", marginBottom: "-1px" }}
|
||||||
/>
|
/>
|
||||||
+{(cacheWrites || 0).toLocaleString()}
|
+{(cacheWrites || 0)?.toLocaleString()}
|
||||||
</span>
|
</span>
|
||||||
<span style={{ display: "flex", alignItems: "center", gap: "3px" }}>
|
<span style={{ display: "flex", alignItems: "center", gap: "3px" }}>
|
||||||
<i
|
<i
|
||||||
className="codicon codicon-arrow-right"
|
className="codicon codicon-arrow-right"
|
||||||
style={{ fontSize: "12px", fontWeight: "bold", marginBottom: 0 }}
|
style={{ fontSize: "12px", fontWeight: "bold", marginBottom: 0 }}
|
||||||
/>
|
/>
|
||||||
{(cacheReads || 0).toLocaleString()}
|
{(cacheReads || 0)?.toLocaleString()}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user