mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-11-01 20:43:33 +00:00
typescript: Fix some issues with recent changes.
In domain-util, we were using `import * as ` syntax which
compiled down to `__importStar(require('...'))` which were
not giving the same result as before and causing errors. This
fixes that.
In logger-util, we were missing the call to .apply function
so it should have been `this._log.apply(...)`, but then when we
use apply typescript still complains about merging string with any[]
so we decided to go with bind.
This commit is contained in:
committed by
Akash Nimare
parent
79d0688bcd
commit
fb700350f9
@@ -3,8 +3,8 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import JsonDB from 'node-json-db';
|
||||
import * as request from 'request';
|
||||
import * as escape from 'escape-html';
|
||||
import request from 'request';
|
||||
import escape from 'escape-html';
|
||||
|
||||
import Logger = require('./logger-util');
|
||||
import electron = require('electron');
|
||||
|
||||
@@ -114,7 +114,8 @@ class Logger {
|
||||
|
||||
setupConsoleMethod(type: string): void {
|
||||
this[type] = (...args: any[]) => {
|
||||
this._log(null, [type].concat(args));
|
||||
const log = this._log.bind(this, type, ...args);
|
||||
log();
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user