Skip to content

Commit 36e6184

Browse files
committed
fix: improve mise update notification if offline
Close #194
1 parent 313444f commit 36e6184

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/miseService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ export class MiseService {
507507
name: string;
508508
requested: string;
509509
current: string;
510-
latest: string;
510+
latest: string | null;
511511
bump: string;
512512
source: { type: string; path: string };
513513
};
@@ -701,7 +701,7 @@ export class MiseService {
701701
raw: version,
702702
latest: version.latest,
703703
current: current,
704-
newVersionAvailable: version.latest !== current,
704+
newVersionAvailable: !!version.latest && version.latest !== current,
705705
};
706706
}
707707

src/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ type MiseToolUpdate = {
4343
name: string;
4444
version: string;
4545
requested_version: string;
46-
latest: string;
46+
latest: string | null;
4747
bump?: string;
4848
source?: MiseToolSource;
4949
};
@@ -105,7 +105,7 @@ type MiseConfig = {
105105
*/
106106
type MiseVersion = {
107107
version: string;
108-
latest: string;
108+
latest: string | null;
109109
os: string;
110110
arch: string;
111111
build_time: string;

src/webviews/Tools.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ export const Tools = () => {
449449
return (
450450
<div title={row.original.source?.path}>
451451
{row.original.version}
452-
{outdatedToolInfo ? (
452+
{outdatedToolInfo?.latest ? (
453453
<small>
454454
<br />({outdatedToolInfo.latest} is available)
455455
</small>

0 commit comments

Comments
 (0)