Skip to content

Commit

Permalink
Fix forced export to ITAD
Browse files Browse the repository at this point in the history
  • Loading branch information
tfedor committed Sep 16, 2024
1 parent 718f4e0 commit 190bb2d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/js/Background/Modules/IsThereAnyDeal/ITADApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,7 @@ export default class ITADApi extends Api implements MessageHandlerInterface {
return;
}

if (force) {
await IndexedDB.clear("dynamicStore");
} else {
if (!force) {
const lastImport = await this.getLastImport();

if (lastImport.to && TimeUtils.isInFuture(lastImport.to + PushGamesInterval)) {
Expand All @@ -332,8 +330,8 @@ export default class ITADApi extends Api implements MessageHandlerInterface {
const ownedPackages: number[] = await dynamicStore.get("ownedPackages") ?? [];
await tx.done;

const newOwnedApps: number[] = ownedApps.filter(id => !lastOwnedApps.has(id));
const newOwnedPackages: number[] = ownedPackages.filter(id => !lastOwnedPackages.has(id));
const newOwnedApps: number[] = ownedApps.filter(id => force || !lastOwnedApps.has(id));
const newOwnedPackages: number[] = ownedPackages.filter(id => force || !lastOwnedPackages.has(id));

if (newOwnedApps.length > 0 || newOwnedPackages.length > 0) {
await this.addToCollection(newOwnedApps, newOwnedPackages);
Expand All @@ -354,7 +352,7 @@ export default class ITADApi extends Api implements MessageHandlerInterface {
const wishlisted: number[] = await dynamicStore.get("wishlisted") ?? [];
await tx.done;

const newWishlisted: number[] = wishlisted.filter(id => !lastWishlisted.has(id));
const newWishlisted: number[] = wishlisted.filter(id => force || !lastWishlisted.has(id));

if (newWishlisted.length > 0) {
await this.addToWaitlist(newWishlisted);
Expand Down

0 comments on commit 190bb2d

Please sign in to comment.