Skip to content

Commit

Permalink
#5649 - Default values for bond settings (at least for bond) got corr…
Browse files Browse the repository at this point in the history
…upted and become wrong after ver 2.26 version installed
  • Loading branch information
rrodionov91 committed Oct 14, 2024
1 parent e8880cd commit 82acbf8
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion packages/ketcher-core/src/utilities/SettingsManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,21 @@ export class SettingsManager {

static getOptions(): SavedOptions {
try {
return JSON.parse(
const optionsFromLocalStorage = JSON.parse(
localStorage.getItem(KETCHER_SAVED_OPTIONS_KEY) || '{}',
);

// In 2.25 default bondLength was set to 2.1 by mistake.
// Current code reset it to 40px
// Can be removed in future versions
if (
optionsFromLocalStorage.bondLength === 2.1 &&
optionsFromLocalStorage.bondLengthUnit === 'px'
) {
optionsFromLocalStorage.bondLength = 40;
}

return optionsFromLocalStorage;
} catch (e) {
KetcherLogger.error('SettingsManager.ts::SettingsManager::getOptions', e);
return {} as SavedOptions;
Expand Down

0 comments on commit 82acbf8

Please sign in to comment.