make return value match mergeTooltipAndShortcut() signature

This commit is contained in:
Damien Elmes 2021-04-23 19:48:36 +10:00
parent 70c3b51b0b
commit aba8df7708

View File

@ -4,6 +4,10 @@ export function mergeTooltipAndShortcut(
tooltip: string | undefined,
shortcutLabel: string | undefined
): string | undefined {
if (!tooltip && !shortcutLabel) {
return undefined;
}
let buf = tooltip ?? "";
if (shortcutLabel) {
buf = `${buf} (${shortcutLabel})`;