From 7957d144ce929a2af39f105b9f5df7e4f1cb3d4f Mon Sep 17 00:00:00 2001 From: James Tanner Date: Sat, 24 Dec 2022 20:15:53 -0500 Subject: [PATCH] Ignore unknown proto fields in json imports --- ui/core/components/importers.ts | 2 +- ui/raid/import_export.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/core/components/importers.ts b/ui/core/components/importers.ts index aef287f650..7e65555da5 100644 --- a/ui/core/components/importers.ts +++ b/ui/core/components/importers.ts @@ -137,7 +137,7 @@ export class IndividualJsonImporter extends Importer { } async onImport(data: string) { - const proto = IndividualSimSettings.fromJsonString(data); + const proto = IndividualSimSettings.fromJsonString(data, { ignoreUnknownFields: true }); if (proto.player?.equipment) { await Database.loadLeftoversIfNecessary(proto.player.equipment); } diff --git a/ui/raid/import_export.ts b/ui/raid/import_export.ts index 01c6dcd8e3..f05abe12d2 100644 --- a/ui/raid/import_export.ts +++ b/ui/raid/import_export.ts @@ -34,7 +34,7 @@ export class RaidJsonImporter extends Importer { } onImport(data: string) { - const settings = RaidSimSettings.fromJsonString(data); + const settings = RaidSimSettings.fromJsonString(data, { ignoreUnknownFields: true }); this.simUI.fromProto(TypedEvent.nextEventID(), settings); this.close(); }