Skip to content

Commit

Permalink
fix: breaking change in library
Browse files Browse the repository at this point in the history
  • Loading branch information
JoakimSM committed Dec 2, 2024
1 parent 55f7e2e commit 8ea01d3
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 46 deletions.
42 changes: 0 additions & 42 deletions flow-typed/npm/query-string_v6.x.x.js

This file was deleted.

23 changes: 23 additions & 0 deletions flow-typed/npm/query-string_v9.x.x.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// flow-typed signature: ec1d99909d639f153164cf55049d63b2
// flow-typed version: <<STUB>>/query-string_v^9.1.1/flow_v0.132.0

/**
* This is an autogenerated libdef stub for:
*
* 'query-string'
*
* Fill this stub out by replacing all the `any` types.
*
* Once filled out, we encourage you to share your work with the
* community by sending a pull request to:
* https://github.com/flowtype/flow-typed
*/

declare module 'query-string' {
declare type QueryParameters = { [string]: string | Array<string | number> | null, ... }

declare module.exports: {
parse(str: string, opts?: any): QueryParameters,
...
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @flow
import * as React from 'react';
import { connect } from 'react-redux';
import { parse, type QueryParameters } from 'query-string';
import queryString, { type QueryParameters } from 'query-string';
import { paramsSelector } from './appSync.selectors';
import { LoadingMaskForPage } from '../LoadingMasks';
import { viewEventFromUrl } from '../Pages/ViewEvent/ViewEventComponent/viewEvent.actions';
Expand Down Expand Up @@ -81,7 +81,7 @@ export const withAppUrlSync = () => (InnerComponent: React.ComponentType<any>) =
setPageAndParams() {
const { location } = this.props;
this.page = location.pathname.substring(1);
this.params = parse(location && location.search);
this.params = queryString.parse(location && location.search);
}

render() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @namespace UrlSync
*/
import * as React from 'react';
import { parse, type QueryParameters } from 'query-string';
import queryString, { type QueryParameters } from 'query-string';
import { pageFetchesOrgUnitUsingTheOldWay } from '../../utils/url';

type Props = {
Expand Down Expand Up @@ -96,7 +96,7 @@ const getUrlSyncer = (
isOutOfSync() {
const syncSpecification = onGetSyncSpecification(this.props);
const { history: { location }, statePage, urlPage } = this.props;
const locationParams = parse(location && location.search);
const locationParams = queryString.parse(location && location.search);
const urlParamsAreOutOfSync = this.paramsNeedsUpdate(syncSpecification, locationParams);
const urlPathnameIsOutOfSync = urlPage !== statePage;

Expand Down

0 comments on commit 8ea01d3

Please sign in to comment.