Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions src/selectors/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -223,20 +223,29 @@ export const getTimelineHeight: Selector<null | CssPixels> = createSelector(
* Used by the drag and drop component in order to determine if it can
* load a dropped profile file.
*/
export const getIsNewProfileLoadAllowed: Selector<boolean> = createSelector(
export const getIsNewProfileLoadAllowed = createSelector(
getView,
getDataSource,
getZipFileState,
(view, dataSource, zipFileState) => {
getIsDragAndDropDragging,
getDragSource, // ← this is the missing piece
(view, dataSource, zipFileState, isDragging, dragSource) => {
const appPhase = view.phase;
const zipPhase = zipFileState.phase;

const isLoading =
(appPhase === 'INITIALIZING' && dataSource !== 'none') ||
zipPhase === 'PROCESS_PROFILE_FROM_ZIP_FILE';
return !isLoading;

return (
!isLoading &&
isDragging &&
dragSource === 'EXTERNAL_FILE'
);
}
);


/**
* Returns the indexes of categories that are opened in the sidebar,
* for every category
Expand Down