diff --git a/tools/test-js-with-node b/tools/test-js-with-node index 1a9d7b83a2..96085b18f0 100755 --- a/tools/test-js-with-node +++ b/tools/test-js-with-node @@ -78,7 +78,7 @@ EXEMPT_FILES = make_set( "web/src/css_variables.js", "web/src/dark_theme.ts", "web/src/debug.ts", - "web/src/deprecated_feature_notice.js", + "web/src/deprecated_feature_notice.ts", "web/src/desktop_integration.js", "web/src/dialog_widget.ts", "web/src/drafts.js", diff --git a/web/src/deprecated_feature_notice.js b/web/src/deprecated_feature_notice.ts similarity index 88% rename from web/src/deprecated_feature_notice.js rename to web/src/deprecated_feature_notice.ts index ec46503f3b..b1ef69f99c 100644 --- a/web/src/deprecated_feature_notice.js +++ b/web/src/deprecated_feature_notice.ts @@ -6,7 +6,10 @@ import * as dialog_widget from "./dialog_widget"; import {$t_html} from "./i18n"; import {localstorage} from "./localstorage"; -export function get_hotkey_deprecation_notice(originalHotkey, replacementHotkey) { +export function get_hotkey_deprecation_notice( + originalHotkey: string, + replacementHotkey: string, +): string { return $t_html( { defaultMessage: @@ -16,9 +19,9 @@ export function get_hotkey_deprecation_notice(originalHotkey, replacementHotkey) ); } -let shown_deprecation_notices = []; +let shown_deprecation_notices: string[] = []; -export function maybe_show_deprecation_notice(key) { +export function maybe_show_deprecation_notice(key: string): void { let message; const isCmdOrCtrl = common.has_mac_keyboard() ? "Cmd" : "Ctrl"; switch (key) { @@ -56,7 +59,9 @@ export function maybe_show_deprecation_notice(key) { html_heading: $t_html({defaultMessage: "Deprecation notice"}), html_body: message, html_submit_button: $t_html({defaultMessage: "Got it"}), - on_click() {}, + on_click() { + return; + }, close_on_submit: true, focus_submit_on_open: true, single_footer_button: true,