Skip to content
This repository was archived by the owner on Sep 2, 2021. It is now read-only.
Merged
Changes from 3 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
10 changes: 6 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ define(function (require, exports, module) {
// Local variables
var lastFontSelected = null;
var lastTwentyFonts = [];
var prefs = {};
var prefs;
var whitespaceRegExp = /\s/;
var commaSemiRegExp = /([;,])/;
var fontnameStartRegExp = /[\w"',]/;
Expand Down Expand Up @@ -218,7 +218,8 @@ define(function (require, exports, module) {
if (lastTwentyFonts.length > 20) {
lastTwentyFonts.splice(20, lastTwentyFonts.length - 20);
}
prefs.setValue(PREFERENCES_FONT_HISTORY_KEY, lastTwentyFonts);
prefs.set(PREFERENCES_FONT_HISTORY_KEY, lastTwentyFonts);
prefs.save();
}

function _showHowtoDialog() {
Expand Down Expand Up @@ -523,8 +524,9 @@ define(function (require, exports, module) {
});

// setup preferences
prefs = PreferencesManager.getPreferenceStorage(PREFERENCES_CLIENT_ID);
lastTwentyFonts = prefs.getValue(PREFERENCES_FONT_HISTORY_KEY);
prefs = PreferencesManager.getExtensionPrefs(PREFERENCES_CLIENT_ID);
PreferencesManager.convertPreferences(module, { "ewf-font-history": "user com.adobe.edgewebfonts.ewf-font-history" });
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@bchintx Have you tested with font history migration? I asked because I'm not familiar with accessing the old local storage. What I noticed here is you're combining PREFERENCES_CLIENT_ID and PREFERENCES_FONT_HISTORY_KEY using dot. If PREFERENCES_FONT_HISTORY_KEY is stored as a property of PREFERENCES_CLIENT_ID, then it makes sense. Just want to make sure that this code works as expected.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@RaymondLim Hmm. Good point. It looks like this extension prefixes it's preferences differently than, say, the Edge Inspect extension. As a result, the conversion isn't working. Let me investigate.

lastTwentyFonts = prefs.get(PREFERENCES_FONT_HISTORY_KEY);
if (!lastTwentyFonts) {
lastTwentyFonts = [];
}
Expand Down