diff --git a/extension/src/extension.ts b/extension/src/extension.ts index ece47bba..627db45c 100644 --- a/extension/src/extension.ts +++ b/extension/src/extension.ts @@ -38,13 +38,13 @@ export class Extension { const storageProvider = new StorageProvider(ctx?.globalState) // Display any notifications from remote server - flowVersion.getValue().then(flowVersion => { + void flowVersion.getValue().then(flowVersion => { if (flowVersion == null) return - const notificationFilter = (notifications: Notification[]) => filterNotifications(notifications, storageProvider, { - 'vscode-cadence': this.ctx.extension.packageJSON.version ?? '0.0.0', + const notificationFilter = (notifications: Notification[]): Notification[] => filterNotifications(notifications, storageProvider, { + 'vscode-cadence': this.ctx.extension.packageJSON.version, 'flow-cli': flowVersion.version }) - fetchNotifications(notificationFilter).then(notifications => { + void fetchNotifications(notificationFilter).then(notifications => { displayNotifications(notifications, storageProvider) }) }) diff --git a/extension/src/ui/notifications.ts b/extension/src/ui/notifications.ts index afeaf22f..d8116c0d 100644 --- a/extension/src/ui/notifications.ts +++ b/extension/src/ui/notifications.ts @@ -28,7 +28,7 @@ export function displayNotifications (notifications: Notification[], storageProv } export function displayNotification (notification: Notification, storageProvider: StorageProvider): void { - const transformButton = (button: { label: string, link: string }) => { + const transformButton = (button: { label: string, link: string }): { label: string, callback: () => void } => { return { label: button.label, callback: () => { @@ -56,7 +56,7 @@ export function displayNotification (notification: Notification, storageProvider export function filterNotifications (notifications: Notification[], storageProvider: StorageProvider, currentVersions: { 'vscode-cadence': string, 'flow-cli': string }): Notification[] { return notifications.filter(notification => { - if (notification.suppressable && isNotificationDismissed(notification, storageProvider)) { + if (notification.suppressable === true && isNotificationDismissed(notification, storageProvider)) { return false } diff --git a/extension/test/integration/2 - commands.test.ts b/extension/test/integration/2 - commands.test.ts index 7ed491d7..e87c5a4f 100644 --- a/extension/test/integration/2 - commands.test.ts +++ b/extension/test/integration/2 - commands.test.ts @@ -1,5 +1,3 @@ -import { getMockSettings } from '../mock/mockSettings' -import { Settings } from '../../src/settings/settings' import { MaxTimeout } from '../globals' import { before, after } from 'mocha' import * as assert from 'assert' @@ -9,14 +7,12 @@ import { DependencyInstaller } from '../../src/dependency-installer/dependency-i import * as sinon from 'sinon' suite('Extension Commands', () => { - let settings: Settings let checkDependenciesStub: sinon.SinonStub let mockDependencyInstaller: DependencyInstaller let commandController: CommandController before(async function () { this.timeout(MaxTimeout) - settings = getMockSettings() // Initialize the command controller & mock dependencies checkDependenciesStub = sinon.stub()