Bugfixes
This commit is contained in:
20
Backend/dist/Pages/Page.js
vendored
20
Backend/dist/Pages/Page.js
vendored
@@ -9,15 +9,15 @@ var __assign = (this && this.__assign) || function () {
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
exports.__esModule = true;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var fs_extra_1 = require("fs-extra");
|
||||
var path = require("path");
|
||||
var Logger_1 = require("../Logger");
|
||||
module.exports = /** @class */ (function () {
|
||||
function Page(settings) {
|
||||
this.pageFilePath = path.join(Undecked.dataPath, 'pages', settings.pageID + ".json");
|
||||
this.pageFilePath = path.join(Undecked.dataPath, 'pages', "".concat(settings.pageID, ".json"));
|
||||
this.pageID = settings.pageID;
|
||||
this.name = settings.name || "Unnamed page (" + this.pageID + ")";
|
||||
this.name = settings.name || "Unnamed page (".concat(this.pageID, ")");
|
||||
this.keys = settings.keys || {};
|
||||
this.ensureKeys();
|
||||
}
|
||||
@@ -25,17 +25,17 @@ module.exports = /** @class */ (function () {
|
||||
var _this = this;
|
||||
clearTimeout(this.saveTimeout);
|
||||
this.saveTimeout = setTimeout(function () {
|
||||
fs_extra_1.writeJson(_this.pageFilePath, _this["export"](), function (err) {
|
||||
(0, fs_extra_1.writeJson)(_this.pageFilePath, _this.export(), function (err) {
|
||||
if (err)
|
||||
Logger_1.Log('error', "Error whilst saving page " + _this.pageID, err.message);
|
||||
(0, Logger_1.Log)('error', "Error whilst saving page ".concat(_this.pageID), err.message);
|
||||
else
|
||||
Logger_1.Log('info', "Page " + _this.pageID + " has been saved");
|
||||
(0, Logger_1.Log)('info', "Page ".concat(_this.pageID, " has been saved"));
|
||||
if (callback)
|
||||
callback();
|
||||
});
|
||||
}, 10 * 1000);
|
||||
};
|
||||
Page.prototype["export"] = function () {
|
||||
Page.prototype.export = function () {
|
||||
var keys = JSON.parse(JSON.stringify(this.keys));
|
||||
for (var y in keys) {
|
||||
for (var x in keys[y]) {
|
||||
@@ -113,8 +113,8 @@ module.exports = /** @class */ (function () {
|
||||
//----------------------------------Validating key
|
||||
var masterResponseToken = originQuery == undefined
|
||||
? responseToken
|
||||
: this.pageID + "_" + x + "_" + y == originQuery ? responseToken : '-1';
|
||||
originQuery = this.pageID + "_" + x + "_" + y;
|
||||
: "".concat(this.pageID, "_").concat(x, "_").concat(y) == originQuery ? responseToken : '-1';
|
||||
originQuery = "".concat(this.pageID, "_").concat(x, "_").concat(y);
|
||||
var decks = Undecked.Decks.decks;
|
||||
var currentKey = this.keys[y][x];
|
||||
var grabBest = function (object, value, defaultValue, incommingFirst) {
|
||||
@@ -264,7 +264,7 @@ module.exports = /** @class */ (function () {
|
||||
if (ghostKeyClone.state != undefined && ghostKeyClone.state.masterID == id) {
|
||||
var responseTokenGhost = originQuery == undefined
|
||||
? responseToken
|
||||
: ghostLocation.pageID + "_" + ghostLocation.x + "_" + ghostLocation.y == originQuery
|
||||
: "".concat(ghostLocation.pageID, "_").concat(ghostLocation.x, "_").concat(ghostLocation.y) == originQuery
|
||||
? responseToken
|
||||
: '-1';
|
||||
var newGhostKey = __assign(__assign({}, ghostKeyClone), { appearence: ghostAppearence });
|
||||
|
||||
Reference in New Issue
Block a user