File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import {query, state} from 'lit/decorators.js';
66import { Get } from '../../bridge/handlers/storage_get' ;
77import { Set } from '../../bridge/handlers/storage_set' ;
88import { PAGE_SIZE } from '../../storage/keys' ;
9+ import { hasQueryParameter } from '../../utils/browser' ;
910
1011@CustomElement ( )
1112export class PageSize extends FloatElement {
@@ -33,7 +34,11 @@ export class PageSize extends FloatElement {
3334 super . connectedCallback ( ) ;
3435
3536 const size = await Get ( PAGE_SIZE ) ;
36- if ( size ) {
37+
38+ // Don't override if the user is manually overriding the start query param
39+ // ie. "https://steamcommunity.com/market/listings/730/AK-47%20%7C%20Slate%20%28Field-Tested%29?start=100&count=100"
40+ // Steam already has a bug that pagination doesn't work when setting this.
41+ if ( size && ! hasQueryParameter ( 'start' ) ) {
3742 this . changePageSize ( size ) ;
3843 }
3944 }
Original file line number Diff line number Diff line change 1+ /*
2+ * Functions related to the browser page (ie. parsing the URL)
3+ */
4+
5+ export function getQueryParameter ( param : string ) : string | null {
6+ const url = new URL ( window . location . href ) ;
7+ return url . searchParams . get ( param ) ;
8+ }
9+
10+ export function hasQueryParameter ( param : string ) : boolean {
11+ return ! ! getQueryParameter ( param ) ;
12+ }
You can’t perform that action at this time.
0 commit comments