Fix some more lint errors

Signed-off-by: Aaron Raimist <aaron@raim.ist>
This commit is contained in:
Aaron Raimist 2018-10-11 22:05:59 -05:00
parent 954d49f22e
commit 752d816780
No known key found for this signature in database
GPG key ID: 37419210002890EF
3 changed files with 8 additions and 11 deletions

View file

@ -97,19 +97,17 @@ export function _t(text, variables, tags) {
// The translation returns text so there's no XSS vector here (no unsafe HTML, no code execution)
const translated = safeCounterpartTranslate(text, args);
let substituted = substitute(translated, variables, tags);
const substituted = substitute(translated, variables, tags);
// For development/testing purposes it is useful to also output the original string
// Don't do that for release versions
if (ANNOTATE_STRINGS) {
if (typeof substituted === 'string') {
return `@@${text}##${substituted}@@`
}
else {
return `@@${text}##${substituted}@@`;
} else {
return <span className='translated-string' data-orig-string={text}>{substituted}</span>;
}
}
else {
} else {
return substituted;
}
}

View file

@ -22,7 +22,7 @@ import MatrixClientPeg from '../MatrixClientPeg';
import PlatformPeg from '../PlatformPeg';
import { _t } from '../languageHandler';
import rageshake from './rageshake'
import rageshake from './rageshake';
// polyfill textencoder if necessary
@ -59,8 +59,7 @@ export default async function sendBugReport(bugReportEndpoint, opts) {
let version = "UNKNOWN";
try {
version = await PlatformPeg.get().getAppVersion();
}
catch (err) {} // PlatformPeg already logs this.
} catch (err) {} // PlatformPeg already logs this.
let userAgent = "UNKNOWN";
if (window.navigator && window.navigator.userAgent) {
@ -85,7 +84,7 @@ export default async function sendBugReport(bugReportEndpoint, opts) {
if (opts.sendLogs) {
progressCallback(_t("Collecting logs"));
const logs = await rageshake.getLogsForReport();
for (let entry of logs) {
for (const entry of logs) {
// encode as UTF-8
const buf = new TextEncoder().encode(entry.lines);

View file

@ -104,7 +104,7 @@ export default class DMRoomMap {
.some((ids) => ids.roomId === roomId);
});
guessedUserIdsThatChanged.forEach(({userId, roomId}) => {
let roomIds = userToRooms[userId];
const roomIds = userToRooms[userId];
if (!roomIds) {
userToRooms[userId] = [roomId];
} else {