Bugfixes
This commit is contained in:
12
Backend/dist/Icons.js
vendored
12
Backend/dist/Icons.js
vendored
@@ -1,4 +1,4 @@
|
||||
exports.__esModule = true;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Icons = void 0;
|
||||
var fs_1 = require("fs");
|
||||
var path = require("path");
|
||||
@@ -11,8 +11,8 @@ var Icons = /** @class */ (function () {
|
||||
}
|
||||
Icons.prototype.load = function (callback) {
|
||||
var _this = this;
|
||||
Logger_1.Log('info', 'Loading icons');
|
||||
fs_1.readdir(path.join(this.materialPath, 'black'), function (err, files) {
|
||||
(0, Logger_1.Log)('info', 'Loading icons');
|
||||
(0, fs_1.readdir)(path.join(this.materialPath, 'black'), function (err, files) {
|
||||
if (err)
|
||||
throw err;
|
||||
for (var i = 0; i < files.length; i++) {
|
||||
@@ -22,7 +22,7 @@ var Icons = /** @class */ (function () {
|
||||
_this.icons.push({ id: fileID, name: fileID.replace(/_/g, ' ') });
|
||||
}
|
||||
}
|
||||
Logger_1.Log('info', "Loaded " + files.length + " icon(s)");
|
||||
(0, Logger_1.Log)('info', "Loaded ".concat(files.length, " icon(s)"));
|
||||
callback();
|
||||
});
|
||||
};
|
||||
@@ -31,8 +31,8 @@ var Icons = /** @class */ (function () {
|
||||
};
|
||||
Icons.prototype.getPath = function (iconID, style) {
|
||||
if (this.iconIDs.includes(iconID))
|
||||
return path.join(this.materialPath, style, iconID + ".png");
|
||||
console.log("Invalid icon '" + iconID + "'");
|
||||
return path.join(this.materialPath, style, "".concat(iconID, ".png"));
|
||||
console.log("Invalid icon '".concat(iconID, "'"));
|
||||
return null;
|
||||
};
|
||||
return Icons;
|
||||
|
||||
Reference in New Issue
Block a user