fix async realted errors and cleanup

This commit is contained in:
Nuwan 2022-08-03 18:38:42 +05:30
parent 11915454cb
commit 09e1d27c64
6 changed files with 22 additions and 44 deletions

View File

@ -770,6 +770,8 @@
}
//const clientTypePromise = context.JK.clientType();
const clientType = context.JK.clientType();
const operatingModePromise = context.jamClient.getOperatingMode();
const macHashPromise = context.jamClient.SessionGetMacHash();
const osStringPromise = context.JK.GetOSAsString();
@ -784,10 +786,10 @@
connectDeferred = new $.Deferred();
Promise.all(allPromises).then((values) => {
clientType = values[0];
mode = values[1];
machine = values[2];
os = values[3];
//clientType = values[0];
mode = values[0];
machine = values[1];
os = values[2];
console.log("clientType, mode, machine", clientType, mode, machine, os);
isLatencyTesterMode = mode == "server";

View File

@ -224,17 +224,17 @@ AppStore = context.AppStore
'now!'
timeString
# comparePlans: (e) ->
# if context.JK.clientType() == 'client'
# context.JK.popExternalLink("https://jamkazam.freshdesk.com/support/solutions/articles/66000122535-what-are-jamkazam-s-free-vs-premium-features-")
# e.preventDefault()
comparePlans: (e) ->
if context.JK.clientType() == 'client'
context.JK.popExternalLink("https://jamkazam.freshdesk.com/support/solutions/articles/66000122535-what-are-jamkazam-s-free-vs-premium-features-")
e.preventDefault()
comparePlans: `async function(e) {
if (await context.JK.clientType() === 'client') {
context.JK.popExternalLink("https://jamkazam.freshdesk.com/support/solutions/articles/66000122535-what-are-jamkazam-s-free-vs-premium-features-");
return e.preventDefault();
}
}`
# comparePlans: `function(e) {
# if (context.JK.clientType() === 'client') {
# context.JK.popExternalLink("https://jamkazam.freshdesk.com/support/solutions/articles/66000122535-what-are-jamkazam-s-free-vs-premium-features-");
# return e.preventDefault();
# }
# }`
render: () ->
plan_codes = []

View File

@ -1104,8 +1104,6 @@ ConfigureTracksActions = @ConfigureTracksActions
}catch(error){
console.log("===== ERROR ====", error);
alert('test error')
SessionActions.leaveSession.trigger({location: '/client#/home'});
}
}`
@ -1126,13 +1124,12 @@ ConfigureTracksActions = @ConfigureTracksActions
this.currentSessionId = sessionId;
this.startTime = new Date().getTime();
console.log('==DEBUG SessionId==', this.currentSessionId)
//console.log('==DEBUG SessionId==', this.currentSessionId)
try{
const musicSession = await rest.getSessionHistoryPromise(this.currentSessionId)
await this.onJoinSessionDone(musicSession)
}catch(e){
console.log('==DEBUG ERROR==', e)
return logger.error("unable to fetch session history", e);
}
}`

View File

@ -1299,12 +1299,11 @@
}
context.JK.dropdown = async function ($select, options) {
context.JK.dropdown = function ($select, options) {
var opts = options || {}
opts = $.extend({}, {nativeTouch: !(context.JK.isQWebEngine) && gon.global.env != "test", cutOff: 7}, opts)
console.log("===context.JK.dropdown===", opts);
$select.each(function (index) {
var $item = $(this);
@ -1317,22 +1316,6 @@
})
}
// context.JK.dropdown = function ($select, options) {
// var opts = options || {}
// opts = $.extend({}, {nativeTouch: false, cutOff: 7}, opts)
// $select.each(function (index) {
// var $item = $(this);
// if ($item.data('easydropdown-select')) {
// // if this has already been initialized, re-init it so it picks up any new <options>
// $item.easyDropDown('destroy')
// }
// $item.easyDropDown(opts);
// })
// }
context.JK.currentTimezone = function() {
var tz = window.jstz.determine().name()

View File

@ -305,14 +305,10 @@
await assertFTUEProfile();
//var $checkbox = $(this);
console.log('==inputChannelChanged#checkbox', $checkbox.data('id'));
var channelId = $checkbox.data('id');
var isChecked = $checkbox.is(':checked');
console.log('===inputChannelChanged===', $checkbox, channelId, isChecked);
//console.log('===inputChannelChanged===', $checkbox, channelId, isChecked);
if (isChecked) {
@ -384,7 +380,6 @@
context.JK.checkbox($checkbox);
console.log("initializeInputPorts#checkbox", $checkbox);
$checkbox.on('ifChanged', async function(){
console.log("===initializeInputPorts#ifChanged", $(this));
await inputChannelChanged($(this));
});
$inputChannels.append($inputChannel);

View File

@ -337,11 +337,12 @@
return profiles;
}
gearUtils.postDiagnostic = async function (operatingSystem, deviceInformation, selectedDeviceInfo, gearTest, frameBuffers, isAutomated) {
gearUtils.postDiagnostic = function (operatingSystem, deviceInformation, selectedDeviceInfo, gearTest, frameBuffers, isAutomated) {
rest.createDiagnostic({
type: 'GEAR_SELECTION',
data: {
client_type: await context.JK.clientType(),
client_type: context.JK.clientType(),
client_id: context.JK.JamServer.clientID,
summary: gearUtils.ftueSummary(operatingSystem, deviceInformation, selectedDeviceInfo, gearTest, frameBuffers, isAutomated)
}