PromucFlow_constructor/app/client/src/pages/utils.ts
Rishabh Rathod 4e13fc5125
fix: AppViewer init and page fetch logic (#14294)
OnPageSwitch we need not `initializeAppViewPage` but instead, only `fetchPublishedPage` this changes fixes that.
2022-06-10 18:22:59 +00:00

16 lines
433 B
TypeScript

import { getSearchQuery } from "utils/helpers";
import { Location } from "history";
export const getIsBranchUpdated = (
prevLocation: Location<unknown>,
currentLocation: Location<unknown>,
) => {
const { search: search1 } = prevLocation;
const { search: search2 } = currentLocation;
const branch1 = getSearchQuery(search1, "branch");
const branch2 = getSearchQuery(search2, "branch");
return branch1 !== branch2;
};