Skip to content

Commit

Permalink
Ignore userFraction if status is draft (r0adkll#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
boswelja authored Sep 12, 2022
1 parent 6a74f07 commit 5427bcb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/index.js

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions src/edits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,13 @@ async function validateSelectedTrack(appEditId: string, options: EditOptions): P

async function addReleasesToTrack(appEditId: string, options: EditOptions, versionCodes: number[]): Promise<Track> {
const status = options.status
let userFraction: number | undefined = undefined

core.debug(`Creating Track Release for Edit(${appEditId}) for Track(${options.track}) with a UserFraction(${options.userFraction}), Status(${status}), and VersionCodes(${versionCodes})`);
if (options.status != 'draft') {
userFraction = options.userFraction
}

core.debug(`Creating Track Release for Edit(${appEditId}) for Track(${options.track}) with a UserFraction(${userFraction}), Status(${status}), and VersionCodes(${versionCodes})`);
const res = await androidPublisher.edits.tracks
.update({
auth: options.auth,
Expand All @@ -165,7 +170,7 @@ async function addReleasesToTrack(appEditId: string, options: EditOptions, versi
releases: [
{
name: options.name,
userFraction: options.userFraction,
userFraction: userFraction,
status: status,
inAppUpdatePriority: options.inAppUpdatePriority,
releaseNotes: await readLocalizedReleaseNotes(options.whatsNewDir),
Expand Down

0 comments on commit 5427bcb

Please sign in to comment.