Skip to content

Commit

Permalink
fix: broadcast address info updated
Browse files Browse the repository at this point in the history
  • Loading branch information
classicalliu committed Jul 29, 2019
1 parent ce34ee6 commit 7aa4c83
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { remote } from 'electron'
import { Entity, BaseEntity, PrimaryColumn, Column, AfterInsert, AfterUpdate, AfterRemove } from 'typeorm'
import { AddressType } from '../../../models/keys/address'
import { Address as AddressInterface } from '../dao'
Expand All @@ -8,6 +9,11 @@ export enum AddressVersion {
Mainnet = 'mainnet',
}

const isRenderer = process && process.type === 'renderer'
const addressDbChangedSubject = isRenderer
? remote.require('./models/subjects/address-db-changed-subject').default.getSubject()
: AddressDbChangedSubject.getSubject()

@Entity()
export default class Address extends BaseEntity {
@PrimaryColumn({
Expand Down Expand Up @@ -105,6 +111,6 @@ export default class Address extends BaseEntity {
}

private changed = (event: string) => {
AddressDbChangedSubject.getSubject().next(event)
addressDbChangedSubject.next(event)
}
}

0 comments on commit 7aa4c83

Please sign in to comment.