Skip to content

Commit

Permalink
Release v1.0.26
Browse files Browse the repository at this point in the history
  • Loading branch information
gregory-latinier committed Jul 21, 2020
2 parents 01e2d59 + ccf016d commit 25d5cc9
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 49 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hyphadac-quasar",
"version": "1.0.25",
"version": "1.0.26",
"description": "HyphaDAO",
"productName": "HyphaDAO",
"cordovaId": "org.cordova.quasar.app",
Expand Down
6 changes: 0 additions & 6 deletions src/components/layout/left-menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,6 @@ export default {
)
q-item-section(avatar)
q-item-section Enroll Applicants
q-item-section(side)
q-icon(
name="fas fa-lock"
class="text-grey-5"
style="font-size: 18px;"
)
q-separator.q-my-sm
q-item.text-black(to="/members")
q-item-section(avatar)
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/MainLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default {
this.background = `background: url(${pattern.png()})`
this.initNotifications()
await this.fetchPeriods()
if (!await this.autoLogin()) {
if (!await this.autoLogin(this.$router.currentRoute.path)) {
if (!localStorage.getItem('known-user')) {
await this.$router.push({ path: '/welcome' })
} else if (this.$router.currentRoute.path === '/') {
Expand Down
14 changes: 2 additions & 12 deletions src/pages/assignments/components/assignment-card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ export default {
})
}
this.claims = tmp
if (!tmp.length) {
if (!tmp.length && !this.isExpired()) {
this.timeout = setInterval(this.updateCountdown, 1000)
}
},
updateCountdown () {
const end = new Date(this.currentPeriod.start_date).getTime()
const now = new Date(Date.now() + new Date().getTimezoneOffset() * 60 * 1000)
const now = Date.now()
const t = end - now
if (t >= 0) {
const days = Math.floor(t / (1000 * 60 * 60 * 24))
Expand Down Expand Up @@ -109,16 +109,6 @@ export default {
})
},
getExpire (offset) {
if (!this.role) {
return false
}
const roleEndPeriod = this.role.ints.find(o => o.key === 'end_period')
const obj = this.periods.find(p => p.period_id === roleEndPeriod.value)
if (obj && obj.end_date) {
if (Date.now() > new Date(obj.end_date).getTime()) {
return true
}
}
const data = this.assignment.ints.find(o => o.key === 'end_period')
if (data) {
const endPeriod = this.periods.find(p => p.period_id === data.value)
Expand Down
1 change: 1 addition & 0 deletions src/pages/onboarding/login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ q-page.flex.flex-center.column
q-input(
ref="privateKey"
v-model="form.privateKey"
type="password"
label="Private key"
:rules="[rules.required]"
lazy-rules
Expand Down
2 changes: 1 addition & 1 deletion src/pages/payouts/components/payout-form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default {
const deferredSan = isNaN(deferred) ? 0 : parseFloat(deferred || 0)
const instantSan = isNaN(instant) ? 0 : parseFloat(instant || 0)
const ratioUsdEquity = parseFloat(amount || 0)
this.display.hvoice = (2 * ratioUsdEquity).toFixed(2)
this.display.hvoice = ratioUsdEquity.toFixed(2)
this.display.deferredSeeds = (ratioUsdEquity / this.seedsToUsd * (deferredSan / 100) * 1.3).toFixed(4)
this.display.hypha = (ratioUsdEquity * deferredSan / 100 * 0.6).toFixed(2)
this.display.husd = (ratioUsdEquity * (1 - deferredSan / 100) * (instantSan / 100)).toFixed(2)
Expand Down
37 changes: 32 additions & 5 deletions src/pages/profiles/view/wallet-view.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export default {
form: {
amount: 0
},
loading: true,
submitting: false
}
},
Expand Down Expand Up @@ -72,6 +73,7 @@ export default {
...mapMutations('layout', ['setShowRightSidebar', 'setRightSidebarType', 'setBreadcrumbs']),
async loadTokens () {
this.tokens = await this.getTokensAmounts(this.account)
this.loading = false
},
displayForm () {
this.setShowRightSidebar(true)
Expand Down Expand Up @@ -194,7 +196,12 @@ export default {
img.icon(src="~assets/icons/seeds.png")
div
.name DEFERRED SEEDS
.amount {{ new Intl.NumberFormat().format(parseInt(tokens.deferredSeeds), { style: 'currency' }) }}
q-spinner-dots(
v-if="loading"
color="primary"
size="30px"
)
.amount(v-else) {{ new Intl.NumberFormat().format(parseInt(tokens.deferredSeeds), { style: 'currency' }) }}
transition(
appear
enter-active-class="animated slideInRight"
Expand All @@ -204,7 +211,12 @@ export default {
img.icon(src="~assets/icons/seeds.png")
div
.name LIQUID SEEDS
.amount {{ new Intl.NumberFormat().format(parseInt(tokens.liquidSeeds), { style: 'currency' }) }}
q-spinner-dots(
v-if="loading"
color="primary"
size="30px"
)
.amount(v-else) {{ new Intl.NumberFormat().format(parseInt(tokens.liquidSeeds), { style: 'currency' }) }}
transition(
appear
enter-active-class="animated slideInRight"
Expand All @@ -214,7 +226,12 @@ export default {
img.icon(src="~assets/icons/hypha.svg")
div
.name HYPHA
.amount {{ new Intl.NumberFormat().format(parseInt(tokens.hypha), { style: 'currency' }) }}
q-spinner-dots(
v-if="loading"
color="primary"
size="30px"
)
.amount(v-else) {{ new Intl.NumberFormat().format(parseInt(tokens.hypha), { style: 'currency' }) }}
transition(
appear
enter-active-class="animated slideInRight"
Expand All @@ -224,7 +241,12 @@ export default {
img.icon(src="~assets/icons/hvoice.svg")
div
.name HVOICE
.amount {{ new Intl.NumberFormat().format(parseInt(tokens.hvoice), { style: 'currency' }) }}
q-spinner-dots(
v-if="loading"
color="primary"
size="30px"
)
.amount(v-else) {{ new Intl.NumberFormat().format(parseInt(tokens.hvoice), { style: 'currency' }) }}
transition(
appear
enter-active-class="animated slideInRight"
Expand All @@ -242,7 +264,12 @@ export default {
img.icon(src="~assets/icons/husd.svg")
div
.name HUSD
.amount {{ new Intl.NumberFormat().format(parseInt(tokens.husd), { style: 'currency' }) }}
q-spinner-dots(
v-if="loading"
color="primary"
size="30px"
)
.amount(v-else) {{ new Intl.NumberFormat().format(parseInt(tokens.husd), { style: 'currency' }) }}
q-btn.redeem-icon(
v-if="!redeemForm && isMember"
icon="fas fa-grip-lines-vertical"
Expand Down
20 changes: 6 additions & 14 deletions src/pages/roles/components/role-card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,12 @@ export default {
return null
},
willExpire () {
return this.getExpire(30 * 24 * 60 * 60 * 1000)
// 12 months extension
return this.getExpire(-335 * 24 * 60 * 60 * 1000)
},
isExpired () {
return this.getExpire(0)
// 12 months extension
return this.getExpire(-365 * 24 * 60 * 60 * 1000)
}
},
async mounted () {
Expand Down Expand Up @@ -123,8 +125,8 @@ export default {
})
},
updateCountdown () {
const end = new Date(this.endPhase.start_date).getTime()
const now = new Date(Date.now() + new Date().getTimezoneOffset() * 60 * 1000)
const end = new Date(this.endPhase.start_date).getTime() + 365 * 24 * 60 * 60 * 1000
const now = Date.now()
const t = end - now
if (t >= 0) {
const days = Math.floor(t / (1000 * 60 * 60 * 24))
Expand Down Expand Up @@ -184,16 +186,6 @@ q-card.role
dense
unelevated
)
q-btn(
v-if="willExpire || isExpired"
:disable="!isAuthenticated"
label="Extend"
color="proposal"
@click="extendRole"
rounded
dense
unelevated
)
.countdown.q-mt-sm(v-if="countdown !== '' && !isExpired")
q-icon.q-mr-sm(name="fas fa-exclamation-triangle" size="sm")
| The role will expire in {{ countdown }}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/roles/components/role-proposal-view.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export default {
},
updateCountdown () {
const end = new Date(this.ballot.end_time).getTime()
const now = new Date(Date.now() + new Date().getTimezoneOffset() * 60 * 1000)
const now = Date.now()
const t = end - now
if (t >= 0) {
const days = Math.floor(t / (1000 * 60 * 60 * 24))
Expand Down
6 changes: 0 additions & 6 deletions src/store/accounts/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ export const loginWallet = async function ({ commit, dispatch }, { idx, returnUr
await dispatch('checkMembership')
await dispatch('profiles/getPublicProfile', account, { root: true })
await dispatch('profiles/getDrafts', account, { root: true })
if (localStorage.getItem('profileApiConnected')) {
commit('profiles/setConnected', true, { root: true })
}
}
localStorage.setItem('known-user', true)
if (this.$router.currentRoute.path !== (returnUrl || '/dashboard')) {
Expand All @@ -45,9 +42,6 @@ export const loginInApp = async function ({ commit, dispatch }, { account, priva
this.$inAppUser.getAccountName = () => account
this.$inAppUser.signTransaction = api.transact
this.$ppp.setActiveUser(this.$inAppUser)
if (localStorage.getItem('profileApiConnected')) {
commit('profiles/setConnected', true, { root: true })
}
commit('setAccount', account)
await dispatch('checkMembership')
await dispatch('profiles/getPublicProfile', account, { root: true })
Expand Down
3 changes: 1 addition & 2 deletions src/store/members/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ export const fetchData = async function ({ commit, state }) {
scope: this.$config.contracts.dao,
table: 'members',
lower_bound: state.list.data.length ? state.list.data[state.list.data.length - 1].member : null,
limit: state.list.pagination.limit,
reverse: true
limit: state.list.pagination.limit
})

commit('addMembers', result)
Expand Down

0 comments on commit 25d5cc9

Please sign in to comment.