Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/js/serial_backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ function initializeSerialBackend() {
$('input.auto_connect, span.auto_connect').prop('title', i18n.getMessage('autoConnectDisabled'));
}

// bind UI hook to auto-connect checkbos
// bind UI hook to auto-connect checkbox
$('input.auto_connect').change(function () {
GUI.auto_connect = $(this).is(':checked');

Expand Down Expand Up @@ -193,6 +193,12 @@ function finishClose(finishedCallback) {
// reset active sensor indicators
sensor_status(0);

// reset expert mode
ConfigStorage.get('permanentExpertMode', function (result) {
const checked = result.permanentExpertMode;
$('input[name="expertModeCheckbox"]').prop('checked', checked).trigger('change');
});
Comment on lines +197 to +200
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is not need to use callback syntax now (we should drop that completely...)

Suggested change
ConfigStorage.get('permanentExpertMode', function (result) {
const checked = result.permanentExpertMode;
$('input[name="expertModeCheckbox"]').prop('checked', checked).trigger('change');
});
const result = ConfigStorage.get('permanentExpertMode');
const checked = result.permanentExpertMode;
$('input[name="expertModeCheckbox"]').prop('checked', checked).trigger('change');

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chmelevskij will be fixed in #2636

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, though that one is in already.... soz

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But wait a minute, master already supports sync access, so wouldn't it be better to just go with the correct usage?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


if (wasConnected) {
// detach listeners and remove element data
$('#content').empty();
Expand Down