@nina-protocol/nina-db 0.0.61 → 0.0.63

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -106,10 +106,10 @@ export default class Release extends Model {
106
106
  if (recipient.recipientAuthority.toBase58() !== "11111111111111111111111111111111") {
107
107
  const recipientAccount = await Account.findOrCreate(recipient.recipientAuthority.toBase58());
108
108
  const revenueShares = (await recipientAccount.$relatedQuery('revenueShares')).map(revenueShare => revenueShare.id);
109
- if (!revenueShares.includes(releaseRecord.id) && recipient.percentShares > 0) {
109
+ if (!revenueShares.includes(releaseRecord.id) && recipient.percentShare.toNumber() > 0) {
110
110
  await Account.relatedQuery('revenueShares').for(recipientAccount.id).relate(releaseRecord.id);
111
111
  }
112
- else if (revenueShares.includes(releaseRecord.id) && recipient.percentShares === 0) {
112
+ else if (revenueShares.includes(releaseRecord.id) && recipient.percentShare.toNumber() === 0) {
113
113
  await Account.relatedQuery('revenueShares').for(recipientAccount.id).unrelate().where('id', releaseRecord.id);
114
114
  }
115
115
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nina-protocol/nina-db",
3
- "version": "0.0.61",
3
+ "version": "0.0.63",
4
4
  "description": "",
5
5
  "source": "src/index.js",
6
6
  "main": "dist/index.js",
@@ -118,9 +118,9 @@ export default class Release extends Model {
118
118
  if (recipient.recipientAuthority.toBase58() !== "11111111111111111111111111111111") {
119
119
  const recipientAccount = await Account.findOrCreate(recipient.recipientAuthority.toBase58());
120
120
  const revenueShares = (await recipientAccount.$relatedQuery('revenueShares')).map(revenueShare => revenueShare.id);
121
- if (!revenueShares.includes(releaseRecord.id) && recipient.percentShares > 0) {
121
+ if (!revenueShares.includes(releaseRecord.id) && recipient.percentShare.toNumber() > 0) {
122
122
  await Account.relatedQuery('revenueShares').for(recipientAccount.id).relate(releaseRecord.id);
123
- } else if (revenueShares.includes(releaseRecord.id) && recipient.percentShares === 0) {
123
+ } else if (revenueShares.includes(releaseRecord.id) && recipient.percentShare.toNumber() === 0) {
124
124
  await Account.relatedQuery('revenueShares').for(recipientAccount.id).unrelate().where('id', releaseRecord.id);
125
125
  }
126
126
  }