Fixed buffs not being able to be added to actions after creation
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import SimpleSchema from 'simpl-schema';
|
import SimpleSchema from 'simpl-schema';
|
||||||
|
import { Random } from 'meteor/random';
|
||||||
import { StoredEffectSchema } from '/imports/api/properties/Effects.js';
|
import { StoredEffectSchema } from '/imports/api/properties/Effects.js';
|
||||||
|
|
||||||
let BuffSchema = new SimpleSchema({
|
let BuffSchema = new SimpleSchema({
|
||||||
@@ -42,6 +43,11 @@ let StoredBuffWithIdSchema = new SimpleSchema({
|
|||||||
_id: {
|
_id: {
|
||||||
type: String,
|
type: String,
|
||||||
regEx: SimpleSchema.RegEx.Id,
|
regEx: SimpleSchema.RegEx.Id,
|
||||||
|
autoValue(){
|
||||||
|
if (!this.isSet){
|
||||||
|
return Random.id();
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}).extend(StoredBuffSchema);
|
}).extend(StoredBuffSchema);
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import BuffForm from '/imports/ui/properties/forms/BuffForm.vue';
|
import BuffForm from '/imports/ui/properties/forms/BuffForm.vue';
|
||||||
import { StoredBuffSchema } from '/imports/api/properties/Buffs.js';
|
import { StoredBuffWithIdSchema } from '/imports/api/properties/Buffs.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
},
|
},
|
||||||
addBuff(){
|
addBuff(){
|
||||||
this.addBuffLoading = true;
|
this.addBuffLoading = true;
|
||||||
this.$emit('push', {path: [], value: StoredBuffSchema.clean({}), ack: this.acknowledgeAddBuff});
|
this.$emit('push', {path: [], value: StoredBuffWithIdSchema.clean({}), ack: this.acknowledgeAddBuff});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user