Fix reading of launcher settings
Summary: Noticed in a bug report that the read value was `[object Promise]`. This wasn't a huge issue before because the worst case was that when writing settings, it would replace them again with the defaults, but still not great. Reviewed By: mweststrate Differential Revision: D32181718 fbshipit-source-id: cf6cd7aa3bd823845d6657c5466fbcdef6adac28
This commit is contained in:
committed by
Facebook GitHub Bot
parent
3bc8cbc5c5
commit
72c886e91f
@@ -36,7 +36,7 @@ export default class LauncherSettingsStorage implements Storage {
|
|||||||
|
|
||||||
private async parseFile(): Promise<LauncherSettings> {
|
private async parseFile(): Promise<LauncherSettings> {
|
||||||
try {
|
try {
|
||||||
const content = fs.readFile(this.filepath).toString();
|
const content = (await fs.readFile(this.filepath)).toString();
|
||||||
return deserialize(content);
|
return deserialize(content);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn(
|
console.warn(
|
||||||
|
|||||||
Reference in New Issue
Block a user