Skip to content

Commit

Permalink
Merge branch 'trunk' into pr-preview
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonpayton committed Oct 31, 2024
2 parents a33d69d + 1e51248 commit cece255
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
setTemporarySiteSpec,
} from '../../lib/state/redux/slice-sites';
import {
selectActiveSite,
setActiveSite,
useAppDispatch,
useAppSelector,
Expand All @@ -33,6 +34,7 @@ export function EnsurePlaygroundSiteIsSelected({
const siteListingStatus = useAppSelector(
(state) => state.sites.loadingState
);
const activeSite = useAppSelector((state) => selectActiveSite(state));
const dispatch = useAppDispatch();
const url = useCurrentUrl();
const requestedSiteSlug = url.searchParams.get('site-slug');
Expand Down Expand Up @@ -90,7 +92,9 @@ export function EnsurePlaygroundSiteIsSelected({
const newParams = new URLSearchParams(url?.search);
oldParams.delete(notRefreshingParam);
newParams.delete(notRefreshingParam);
if (oldParams.toString() === newParams.toString()) {
const avoidUnnecessaryTempSiteReload =
activeSite && oldParams.toString() === newParams.toString();
if (avoidUnnecessaryTempSiteReload) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ interface GithubImportModalProps {
defaultOpen?: boolean;
onImported?: GitHubImportFormProps['onImported'];
}
export function GithubImportModal({ defaultOpen, onImported }: GithubImportModalProps) {
export function GithubImportModal({
defaultOpen,
onImported,
}: GithubImportModalProps) {
const dispatch: PlaygroundDispatch = useDispatch();
const playground = usePlaygroundClient();

Expand All @@ -20,10 +23,9 @@ export function GithubImportModal({ defaultOpen, onImported }: GithubImportModal
url.searchParams.set('modal', 'github-import');
window.history.replaceState({}, '', url.href);
}, []);

const closeModal = () => {
dispatch(setActiveModal(null));
}
};
return (
<Modal
title={'Import from GitHub'}
Expand Down

0 comments on commit cece255

Please sign in to comment.