Skip to content

Commit

Permalink
fix rivalry bug and transaction search (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
nmelhado authored Apr 30, 2023
1 parent 2a42c71 commit 813f512
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 7 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All notable changes to this project will be documented in this file.

## [2.2.1] - 2023-04-30

### Fixed

- Fix the error thrown on the rivalry page when the pevious league ID is 0 [(issue #204)](https://github.com/nmelhado/league-page/issues/204)

- Fix transaction search bar to debounce the ur change (focus was changing after every letter typed)

## [2.2.0] - 2023-04-17

### Added
Expand All @@ -12,7 +20,7 @@ All notable changes to this project will be documented in this file.

### Fixed

- Fix rror thrown when no blog is present [(issue #202)](https://github.com/nmelhado/league-page/issues/202)
- Fix error thrown when no blog is present [(issue #202)](https://github.com/nmelhado/league-page/issues/202)
- Turn rosters into a map instead of an array in order to deliver the correct data

## [2.1.6] - 2023-04-15
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "league-page",
"version": "2.2.0",
"version": "2.2.1",
"homepage": "https://github.com/nmelhado/league-page",
"repository": {
"type": "git",
Expand Down
12 changes: 11 additions & 1 deletion src/lib/Transactions/TransactionsPage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,23 @@
let lastUpdate = new Date;
let timer;
const debounce = (dest) => {
clearTimeout(timer);
timer = setTimeout(() => {
goto(dest,{noscroll: true, keepfocus: true});
}, 750);
}
const search = () => {
lastUpdate = new Date;
query = query.trimLeft();
if(query.trim() == oldQuery) return;
page = 0;
if(postUpdate) {
goto(`/transactions?show=${show}&query=${query.trim()}&page=${page+1}`, {noscroll: true, keepfocus: true});
const dest = `/transactions?show=${show}&query=${query.trim()}&page=${page+1}`;
debounce(dest);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils/helperFunctions/rivalryMatchups.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const getRivalryMatchups = async (userOneID, userTwoID) => {
matchups: []
}

while(curLeagueID) {
while(curLeagueID && curLeagueID != 0) {
const leagueData = await getLeagueData(curLeagueID).catch((err) => { console.error(err); });
const year = leagueData.season;
const rosterIDOne = getRosterIDFromManagerIDAndYear(teamManagers, userOneID, year);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ available for your copy of League Page
*/

// Keep in sync with package.json
export const version = "2.2.0";
export const version = "2.2.1";

0 comments on commit 813f512

Please sign in to comment.