Commit 672bad47 authored by Bitcoin Please's avatar Bitcoin Please

Adding `inbox` and `outbox` to system.

parent c5095c47
......@@ -6,9 +6,6 @@
/* Initialize vuex. */
import { mapActions, mapGetters } from 'vuex'
/* Import components. */
// import { Notification } from '@/components'
/* Import JQuery. */
// FIXME: Remove ALL jQuery dependencies.
const $ = window.jQuery
......@@ -53,6 +50,12 @@ export default {
}
},
initCoinManager() {
setInterval(() => {
console.log('COIN MANAGER')
}, 5000)
},
/**
* Test IPFS Connection
*/
......@@ -141,6 +144,9 @@ export default {
/* Initialize application. */
this.initApp()
/* Initialize coin manager. */
// this.initCoinManager()
/* Initialize asset source. */
this.updateAssetSource()
......
......@@ -55,7 +55,7 @@ const getMeta = async (state, getters, rootState, rootGetters) => {
/* Set target. */
const target = `http://localhost:6767/v1/meta/${address}`
// const target = `https://api.causes.cash/v1/meta/${ownerAddress}`
// const target = `https://api.causes.cash/v1/meta/${address}`
/* Set contract path. */
const response = await superagent.get(target)
......
......@@ -3,7 +3,9 @@ import getAssetSource from './system/getters/getAssetSource'
import getEternalDbAddr from './system/getters/getEternalDbAddr'
import getFlags from './system/getters/getFlags'
import getHelp from './system/getters/getHelp'
import getInbox from './system/getters/getInbox'
import getLocale from './system/getters/getLocale'
import getOutbox from './system/getters/getOutbox'
/* Import modules (actions). */
import updateAssetSource from './system/actions/updateAssetSource'
......@@ -14,7 +16,9 @@ import updateLocale from './system/actions/updateLocale'
import setAppStarts from './system/mutations/setAppStarts'
import setAssetSource from './system/mutations/setAssetSource'
import setFlags from './system/mutations/setFlags'
import setInbox from './system/mutations/setInbox'
import setLocale from './system/mutations/setLocale'
import setOutbox from './system/mutations/setOutbox'
/* Initialize state. */
const state = {
......@@ -87,7 +91,9 @@ const getters = {
getEternalDbAddr,
getFlags,
getHelp,
getInbox,
getLocale,
getOutbox,
}
/* Actions. */
......@@ -102,7 +108,9 @@ const mutations = {
setAppStarts,
setAssetSource,
setFlags,
setInbox,
setLocale,
setOutbox,
}
/* Export. */
......
......@@ -7,8 +7,17 @@ import msgpack from 'msgpack-lite'
* `_source` is an object, with a key used to describe the asset type.
*/
const setAssets = (state, _source) => {
/* Initialize assets. */
let assets = null
/* Retrieve current assets. */
const assets = state.assets
// const assets = state.assets
try {
assets = msgpack.decode(Buffer.from(state.assets, 'hex'))
} catch (err) {
console.error(err)
assets = state.assets
}
/* Update (merge) assets. */
const updated = {
......
......@@ -9,9 +9,7 @@ import getDerivationPath from './wallet/getters/getDerivationPath'
import getDustAmount from './wallet/getters/getDustAmount'
import getHDNode from './wallet/getters/getHDNode'
import getHistory from './wallet/getters/getHistory'
import getInbox from './wallet/getters/getInbox'
import getMnemonic from './wallet/getters/getMnemonic'
import getOutbox from './wallet/getters/getMnemonic'
/* Import modules (actions). */
import addCoin from './wallet/actions/addCoin'
......@@ -25,8 +23,6 @@ import updateOutbox from './wallet/actions/updateOutbox'
import setAccounts from './wallet/mutations/setAccounts'
import setCoins from './wallet/mutations/setCoins'
import setEmptyWallet from './wallet/mutations/setEmptyWallet'
import setInbox from './wallet/mutations/setInbox'
import setOutbox from './wallet/mutations/setOutbox'
/* Initialize state. */
const state = {
......@@ -77,9 +73,7 @@ const getters = {
getDustAmount,
getHDNode,
getHistory,
getInbox,
getMnemonic,
getOutbox,
}
/* Actions. */
......@@ -97,8 +91,6 @@ const mutations = {
setAccounts,
setCoins,
setEmptyWallet,
setInbox,
setOutbox,
}
/* Export. */
......
......@@ -40,9 +40,15 @@ export default {
watch: {
campaign: function (_campaign) {
/* Handle campaign supporters. */
if (_campaign && _campaign.assurance) {
this.pledges = _campaign.assurance.pledges.filter(pledge => {
return (pledge.isFilled === true || pledge.isSpent === false)
if (_campaign && _campaign.assurances) {
/* Set pledges. */
const pledges = _campaign.assurances.pledges
/* Handle all pledges. */
Object.keys(pledges).filter(pledgeId => {
if (pledges[pledgeId].isFilled === true || pledges[pledgeId].isSpent === false) {
this.pledges.push(pledges[pledgeId])
}
})
/* Sort pledges (decending). */
......
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