🐛 (account) init live for public account created
This commit is contained in:
@@ -124,7 +124,7 @@
|
|||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Component, Vue, Watch } from 'vue-property-decorator'
|
import { Component, Vue, Watch } from 'vue-property-decorator'
|
||||||
import { Getter } from 'vuex-class'
|
import { Action, Getter } from 'vuex-class'
|
||||||
import currencies from '@/data/currencies'
|
import currencies from '@/data/currencies'
|
||||||
import IAccount from '@/models/IAccount'
|
import IAccount from '@/models/IAccount'
|
||||||
import ICurrency from '@/models/ICurrency'
|
import ICurrency from '@/models/ICurrency'
|
||||||
@@ -132,6 +132,7 @@ import accountService from '@/services/AccountService'
|
|||||||
import queueNotifService from '@/services/QueueNotifService'
|
import queueNotifService from '@/services/QueueNotifService'
|
||||||
import IUser from '@/models/IUser'
|
import IUser from '@/models/IUser'
|
||||||
import { slug } from '@/utils'
|
import { slug } from '@/utils'
|
||||||
|
import couchService from '@/services/CouchService'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
components: {
|
components: {
|
||||||
@@ -142,6 +143,8 @@ import { slug } from '@/utils'
|
|||||||
export default class AccountNew extends Vue {
|
export default class AccountNew extends Vue {
|
||||||
@Getter
|
@Getter
|
||||||
public user!: IUser | null
|
public user!: IUser | null
|
||||||
|
@Action
|
||||||
|
public addAccountId!: any
|
||||||
public name: string = ''
|
public name: string = ''
|
||||||
public currencies: ICurrency[] = currencies
|
public currencies: ICurrency[] = currencies
|
||||||
public mainCurrency: ICurrency = currencies[0]
|
public mainCurrency: ICurrency = currencies[0]
|
||||||
@@ -228,6 +231,10 @@ export default class AccountNew extends Vue {
|
|||||||
isPublic: this.isPublic
|
isPublic: this.isPublic
|
||||||
}
|
}
|
||||||
const response: PouchDB.Core.Response = await accountService.add(newAccount)
|
const response: PouchDB.Core.Response = await accountService.add(newAccount)
|
||||||
|
if (newAccount.isPublic) {
|
||||||
|
this.addAccountId({ accountId: response.id })
|
||||||
|
couchService.initLive()
|
||||||
|
}
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
this.$router.push({ name: 'account', params: { id: response.id } })
|
this.$router.push({ name: 'account', params: { id: response.id } })
|
||||||
} else {
|
} else {
|
||||||
@@ -300,4 +307,3 @@ h3 {
|
|||||||
transform: translateY(-50px);
|
transform: translateY(-50px);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user