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