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:
Pascal Hartig
2021-11-05 05:01:32 -07:00
committed by Facebook GitHub Bot
parent 3bc8cbc5c5
commit 72c886e91f

View File

@@ -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(