From e06196a54cd78ebace3d2c0c3cf51b759ed8615f Mon Sep 17 00:00:00 2001 From: Thaum Rystra Date: Sat, 4 Apr 2020 19:09:00 +0200 Subject: [PATCH] Fixed buffs not being able to be added to actions after creation --- app/imports/api/properties/Buffs.js | 6 ++++++ app/imports/ui/properties/forms/BuffListForm.vue | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/imports/api/properties/Buffs.js b/app/imports/api/properties/Buffs.js index f16f5fd7..e62a5db4 100644 --- a/app/imports/api/properties/Buffs.js +++ b/app/imports/api/properties/Buffs.js @@ -1,4 +1,5 @@ import SimpleSchema from 'simpl-schema'; +import { Random } from 'meteor/random'; import { StoredEffectSchema } from '/imports/api/properties/Effects.js'; let BuffSchema = new SimpleSchema({ @@ -42,6 +43,11 @@ let StoredBuffWithIdSchema = new SimpleSchema({ _id: { type: String, regEx: SimpleSchema.RegEx.Id, + autoValue(){ + if (!this.isSet){ + return Random.id(); + } + }, }, }).extend(StoredBuffSchema); diff --git a/app/imports/ui/properties/forms/BuffListForm.vue b/app/imports/ui/properties/forms/BuffListForm.vue index 88fe3552..3dcd1595 100644 --- a/app/imports/ui/properties/forms/BuffListForm.vue +++ b/app/imports/ui/properties/forms/BuffListForm.vue @@ -46,7 +46,7 @@