Bugfixes
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
exports.__esModule = true;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Mitti = void 0;
|
||||
var HyperdeckLib = require("hyperdeck-js-lib");
|
||||
var Mitti = /** @class */ (function () {
|
||||
@@ -22,7 +22,8 @@ var Mitti = /** @class */ (function () {
|
||||
});
|
||||
if (_this.events.connected != undefined)
|
||||
_this.events.connected();
|
||||
})["catch"](function (error) {
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
_this.connected = false;
|
||||
if (_this.events.connecterror != undefined)
|
||||
@@ -31,7 +32,7 @@ var Mitti = /** @class */ (function () {
|
||||
}
|
||||
Mitti.prototype.on = function (event, callback) {
|
||||
if (this.events[event] != undefined)
|
||||
throw new Error("Event '" + event + "' already created");
|
||||
throw new Error("Event '".concat(event, "' already created"));
|
||||
else {
|
||||
this.events[event] = callback;
|
||||
if (event == 'connected' && this.connected == true)
|
||||
@@ -47,7 +48,8 @@ var Mitti = /** @class */ (function () {
|
||||
.then(function (response) {
|
||||
//console.log('Got response with code ' + response.code + '.');
|
||||
resolve(response);
|
||||
})["catch"](function (errResponse) {
|
||||
})
|
||||
.catch(function (errResponse) {
|
||||
if (!errResponse) {
|
||||
reject(new Error('The request failed because the hyperdeck connection was lost.'));
|
||||
}
|
||||
@@ -71,7 +73,8 @@ var Mitti = /** @class */ (function () {
|
||||
else {
|
||||
reject(new Error('Response contained no params'));
|
||||
}
|
||||
})["catch"](function (errResponse) {
|
||||
})
|
||||
.catch(function (errResponse) {
|
||||
if (!errResponse) {
|
||||
reject(new Error('The request failed because the hyperdeck connection was lost.'));
|
||||
}
|
||||
@@ -100,7 +103,8 @@ var Mitti = /** @class */ (function () {
|
||||
else {
|
||||
reject(new Error('Response contained no params data'));
|
||||
}
|
||||
})["catch"](function (errResponse) {
|
||||
})
|
||||
.catch(function (errResponse) {
|
||||
if (!errResponse) {
|
||||
reject(new Error('The request failed because the hyperdeck connection was lost.'));
|
||||
}
|
||||
@@ -126,7 +130,8 @@ var Mitti = /** @class */ (function () {
|
||||
else {
|
||||
reject(new Error('Response contained no clip data'));
|
||||
}
|
||||
})["catch"](function (errResponse) {
|
||||
})
|
||||
.catch(function (errResponse) {
|
||||
if (!errResponse) {
|
||||
reject(new Error('The request failed because the hyperdeck connection was lost.'));
|
||||
}
|
||||
@@ -141,11 +146,12 @@ var Mitti = /** @class */ (function () {
|
||||
return new Promise(function (resolve, reject) {
|
||||
//console.log('Selecting clip');
|
||||
_this_1.hyperdeck
|
||||
.makeRequest("goto: clip id: " + index)
|
||||
.makeRequest("goto: clip id: ".concat(index))
|
||||
.then(function (response) {
|
||||
//console.log('Got response with code ' + response.code + '.');
|
||||
resolve(true);
|
||||
})["catch"](function (errResponse) {
|
||||
})
|
||||
.catch(function (errResponse) {
|
||||
if (!errResponse) {
|
||||
reject(new Error('The request failed because the hyperdeck connection was lost.'));
|
||||
}
|
||||
@@ -164,7 +170,8 @@ var Mitti = /** @class */ (function () {
|
||||
.then(function (response) {
|
||||
//console.log('Got response with code ' + response.code + '.');
|
||||
resolve(true);
|
||||
})["catch"](function (errResponse) {
|
||||
})
|
||||
.catch(function (errResponse) {
|
||||
if (!errResponse) {
|
||||
reject(new Error('The request failed because the hyperdeck connection was lost.'));
|
||||
}
|
||||
@@ -183,7 +190,8 @@ var Mitti = /** @class */ (function () {
|
||||
.then(function (response) {
|
||||
//console.log('Got response with code ' + response.code + '.');
|
||||
resolve(true);
|
||||
})["catch"](function (errResponse) {
|
||||
})
|
||||
.catch(function (errResponse) {
|
||||
if (!errResponse) {
|
||||
reject(new Error('The request failed because the hyperdeck connection was lost.'));
|
||||
}
|
||||
@@ -205,12 +213,14 @@ var Mitti = /** @class */ (function () {
|
||||
.then(function (clipCount) {
|
||||
if (newClip > clipCount)
|
||||
newClip = 1;
|
||||
_this_1.selectClip(newClip).then(resolve)["catch"](reject);
|
||||
})["catch"](reject);
|
||||
_this_1.selectClip(newClip).then(resolve).catch(reject);
|
||||
})
|
||||
.catch(reject);
|
||||
}
|
||||
else
|
||||
_this_1.selectClip(newClip).then(resolve)["catch"](reject);
|
||||
})["catch"](reject);
|
||||
_this_1.selectClip(newClip).then(resolve).catch(reject);
|
||||
})
|
||||
.catch(reject);
|
||||
});
|
||||
};
|
||||
Mitti.prototype.previous = function (wrap) {
|
||||
@@ -225,12 +235,14 @@ var Mitti = /** @class */ (function () {
|
||||
.then(function (clipCount) {
|
||||
if (newClip < 1)
|
||||
newClip = clipCount;
|
||||
_this_1.selectClip(newClip).then(resolve)["catch"](reject);
|
||||
})["catch"](reject);
|
||||
_this_1.selectClip(newClip).then(resolve).catch(reject);
|
||||
})
|
||||
.catch(reject);
|
||||
}
|
||||
else
|
||||
_this_1.selectClip(newClip).then(resolve)["catch"](reject);
|
||||
})["catch"](reject);
|
||||
_this_1.selectClip(newClip).then(resolve).catch(reject);
|
||||
})
|
||||
.catch(reject);
|
||||
});
|
||||
};
|
||||
return Mitti;
|
||||
|
||||
Reference in New Issue
Block a user