Commit 24bef1b6 authored by Bitcoin Please's avatar Bitcoin Please

Meta fix.

parent 0bc4f11a
......@@ -67,8 +67,7 @@ const getMeta = async (state, getters, rootState, rootGetters) => {
/* Validate resopnse. */
// FIXME: This may be singleton OR not index-0
if (response && response.body && response.body[0].meta) {
if (response && response.body && response.body[0] && response.body[0].meta) {
/* Set (encrypted) metadata. */
const encrypted = response.body[0].meta // FIXME: This may be singleton OR not index-0
// console.log('GET META (encrypted):', encrypted)
......
......@@ -628,11 +628,14 @@ export default {
this.pledgeAuth = encodedPledge
/* Initialize meta. */
const meta = await this.getMeta
let meta = await this.getMeta
console.log('FLIPSTARTER (meta):', meta)
/* Set coin id. */
const coinid = `${_coin.txid}:${_coin.vout}`
/* Validate metadata. */
// NOTE: Added to schema on 2020.7.27
if (!meta) {
meta = {}
}
/* Validate coins. */
// NOTE: Added to schema on 2020.7.27
......@@ -640,6 +643,9 @@ export default {
meta.coins = {}
}
/* Set coin id. */
const coinid = `${_coin.txid}:${_coin.vout}`
/* Update meta data. */
meta['coins'][coinid] = {
label: alias,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment