@internetarchive/collection-browser 0.3.1-alpha.2 → 0.3.1-alpha.3

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.
@@ -1,4 +1,4 @@
1
- import { SearchType, SortDirection, SortParam } from '@internetarchive/search-service';
1
+ import type { SortDirection, SortParam } from '@internetarchive/search-service';
2
2
  import { getCookie, setCookie } from 'typescript-cookie';
3
3
  import {
4
4
  MetadataFieldToSortField,
@@ -14,7 +14,6 @@ import {
14
14
 
15
15
  export interface RestorationState {
16
16
  displayMode?: CollectionDisplayMode;
17
- searchType?: SearchType;
18
17
  sortParam?: SortParam;
19
18
  selectedSort?: SortField;
20
19
  sortDirection?: SortDirection;
@@ -88,17 +87,12 @@ export class RestorationStateHandler
88
87
  private persistQueryStateToUrl(state: RestorationState) {
89
88
  const url = new URL(window.location.href);
90
89
  const { searchParams } = url;
91
- searchParams.delete('sin');
92
90
  searchParams.delete('sort');
93
91
  searchParams.delete('query');
94
92
  searchParams.delete('page');
95
93
  searchParams.delete('and[]');
96
94
  searchParams.delete('not[]');
97
95
 
98
- if (state.searchType) {
99
- searchParams.set('sin', state.searchType === SearchType.FULLTEXT ? 'TXT' : '');
100
- }
101
-
102
96
  if (state.sortParam) {
103
97
  const prefix = state.sortParam.direction === 'desc' ? '-' : '';
104
98
  searchParams.set('sort', `${prefix}${state.sortParam.field}`);
@@ -161,7 +155,6 @@ export class RestorationStateHandler
161
155
 
162
156
  private loadQueryStateFromUrl(): RestorationState {
163
157
  const url = new URL(window.location.href);
164
- const searchInside = url.searchParams.get('sin');
165
158
  const pageNumber = url.searchParams.get('page');
166
159
  const searchQuery = url.searchParams.get('query');
167
160
  const sortQuery = url.searchParams.get('sort');
@@ -180,11 +173,6 @@ export class RestorationStateHandler
180
173
  },
181
174
  };
182
175
 
183
- if (searchInside) {
184
- restorationState.searchType = searchInside === 'TXT'
185
- ? SearchType.FULLTEXT
186
- : SearchType.METADATA;
187
- }
188
176
  if (pageNumber) {
189
177
  const parsed = parseInt(pageNumber, 10);
190
178
  restorationState.currentPage = parsed;