Merge pull request #957 from matrix-org/t3chguy/commandprovider_typo

`t_` -> `_t` fix typo
This commit is contained in:
Matthew Hodgson 2017-05-30 00:07:04 +01:00 committed by GitHub
commit 4d900ec220

View file

@ -45,10 +45,10 @@ const COMMANDS = [
command: '/ddg', command: '/ddg',
args: '<query>', args: '<query>',
description: 'Searches DuckDuckGo for results', description: 'Searches DuckDuckGo for results',
} },
]; ];
let COMMAND_RE = /(^\/\w*)/g; const COMMAND_RE = /(^\/\w*)/g;
let instance = null; let instance = null;
@ -62,15 +62,15 @@ export default class CommandProvider extends AutocompleteProvider {
async getCompletions(query: string, selection: {start: number, end: number}) { async getCompletions(query: string, selection: {start: number, end: number}) {
let completions = []; let completions = [];
let {command, range} = this.getCurrentCommand(query, selection); const {command, range} = this.getCurrentCommand(query, selection);
if (command) { if (command) {
completions = this.fuse.search(command[0]).map(result => { completions = this.fuse.search(command[0]).map((result) => {
return { return {
completion: result.command + ' ', completion: result.command + ' ',
component: (<TextualCompletion component: (<TextualCompletion
title={result.command} title={result.command}
subtitle={result.args} subtitle={result.args}
description={ t_(result.description) } description={ _t(result.description) }
/>), />),
range, range,
}; };
@ -84,8 +84,7 @@ export default class CommandProvider extends AutocompleteProvider {
} }
static getInstance(): CommandProvider { static getInstance(): CommandProvider {
if (instance == null) if (instance === null) instance = new CommandProvider();
{instance = new CommandProvider();}
return instance; return instance;
} }