Skip to content

Commit

Permalink
fix: startsWith not a function error (#7201)
Browse files Browse the repository at this point in the history
  • Loading branch information
CurryYangxx authored Mar 25, 2024
1 parent 53f56c1 commit 5ff9ed9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/insomnia/src/ui/routes/project.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,8 @@ async function getAllLocalFiles({
modifiedLocally > workspaceMeta?.cachedGitLastCommitTime
);

const specVersion = spec?.info?.version ? String(spec?.info?.version) : '';

return {
id: workspace._id,
name: workspace.name,
Expand All @@ -382,7 +384,7 @@ async function getAllLocalFiles({
lastModifiedTimestamp: (hasUnsavedChanges && modifiedLocally) || workspaceMeta?.cachedGitLastCommitTime || lastModifiedTimestamp,
branch: lastActiveBranch || '',
lastCommit: hasUnsavedChanges && workspaceMeta?.cachedGitLastCommitTime && lastCommitAuthor ? `by ${lastCommitAuthor}` : '',
version: spec?.info?.version ? `${spec?.info?.version?.startsWith('v') ? '' : 'v'}${spec?.info?.version}` : '',
version: specVersion ? `${specVersion?.startsWith('v') ? '' : 'v'}${specVersion}` : '',
oasFormat: specFormat ? `${specFormat === 'openapi' ? 'OpenAPI' : 'Swagger'} ${specFormatVersion || ''}` : '',
mockServer,
apiSpec,
Expand Down

0 comments on commit 5ff9ed9

Please sign in to comment.