Skip to content

Commit

Permalink
Replaced structuredClone with old school JSON parse/stringify
Browse files Browse the repository at this point in the history
  • Loading branch information
Lakeyzer committed May 12, 2024
1 parent d829b41 commit 782620e
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/views/UserContent/Encounters/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -526,17 +526,20 @@ export default {
async dialogCloneEncounter(key) {
this.clone = true;
this.cloneEncounterData.key = key;
this.cloneEncounterData.ogEncounter = structuredClone(
await this.get_encounter({
uid: this.user.uid,
campaignId: this.campaignId,
id: key,
})
const ogEncounter = JSON.parse(
JSON.stringify(
await this.get_encounter({
uid: this.user.uid,
campaignId: this.campaignId,
id: key,
})
)
);
this.cloneEncounterData.name = structuredClone(this.cloneEncounterData.ogEncounter.name);
this.cloneEncounterData.ogEncounter = ogEncounter;
this.cloneEncounterData.name = ogEncounter.name;
},
async cloneEncounter() {
const encounter = structuredClone(this.cloneEncounterData.ogEncounter);
const encounter = this.cloneEncounterData.ogEncounter;
encounter.name = this.cloneEncounterData.name;
const new_id = await this.add_encounter({
campaignId: this.campaignId,
Expand Down

0 comments on commit 782620e

Please sign in to comment.