Merge pull request #16597 from Snuffleupagus/firefox-getPreferences-cleanup

[Firefox] Simplify `FirefoxPreferences._readFromStorage` (PR 16583 follow-up)
This commit is contained in:
Tim van der Meij 2023-06-24 19:34:42 +02:00 committed by GitHub
commit 371ee778ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -175,8 +175,7 @@ class DownloadManager {
class FirefoxPreferences extends BasePreferences { class FirefoxPreferences extends BasePreferences {
async _readFromStorage(prefObj) { async _readFromStorage(prefObj) {
const prefs = await FirefoxCom.requestAsync("getPreferences", prefObj); return FirefoxCom.requestAsync("getPreferences", prefObj);
return typeof prefs === "string" ? JSON.parse(prefs) : prefs;
} }
} }