Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1688,6 +1688,16 @@
"view": "github:activePullRequest:welcome",
"when": "!github:stateValidated",
"contents": "%welcome.github.activePullRequest.contents%"
},
{
"view": "notifications:github",
"when": "!github:notificationCount",
"contents": "%welcome.github.notificationsLoading.contents%"
},
{
"view": "notifications:github",
"when": "ReposManagerStateContext == RepositoriesLoaded && github:notificationCount == 0",
"contents": "%welcome.github.notifications.contents%"
}
],
"keybindings": [
Expand Down
2 changes: 2 additions & 0 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,8 @@
"Please make sure there is no space between the right bracket and left parenthesis: ]( this is an internal syntax for links"
]
},
"welcome.github.notificationsLoading.contents": "Loading...",
"welcome.github.notifications.contents": "No notifications, your inbox is empty $(rocket)",
"welcome.issues.github.uninitialized.contents": "Loading...",
"welcome.issues.github.noFolder.contents": "You have not yet opened a folder.",
"welcome.issues.github.noRepo.contents": "No git repositories found",
Expand Down
1 change: 1 addition & 0 deletions src/common/executeCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export namespace contexts {
export const PULL_REQUEST_DESCRIPTION_VISIBLE = 'github:pullRequestDescriptionVisible'; // Boolean indicating if the pull request description is visible
export const ACTIVE_COMMENT_HAS_SUGGESTION = 'github:activeCommentHasSuggestion'; // Boolean indicating if the active comment has a suggestion
export const CREATING = 'pr:creating';
export const NOTIFICATION_COUNT = 'github:notificationCount'; // Number of notifications in the notifications view
}

export namespace commands {
Expand Down
2 changes: 2 additions & 0 deletions src/notifications/notificationsProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import * as vscode from 'vscode';
import { AuthProvider } from '../common/authentication';
import { commands, contexts } from '../common/executeCommands';
import { Disposable } from '../common/lifecycle';
import { EXPERIMENTAL_NOTIFICATIONS_PAGE_SIZE, PR_SETTINGS_NAMESPACE } from '../common/settingKeys';
import { OctokitCommon } from '../github/common';
Expand Down Expand Up @@ -101,6 +102,7 @@ export class NotificationsProvider extends Disposable {
.map((notification: OctokitCommon.Notification) => parseNotification(notification))
.filter(notification => !!notification) as Notification[];

commands.setContext(contexts.NOTIFICATION_COUNT, notifications.length);
return { notifications, hasNextPage: headers.link?.includes(`rel="next"`) === true };
}

Expand Down