Skip to content

Commit

Permalink
[feat-75] added fix on rebasing 1
Browse files Browse the repository at this point in the history
  • Loading branch information
silentrald committed Oct 8, 2024
1 parent 7e851c5 commit 615ac04
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,9 @@ export class LocalMapsManagerService {
total: 0,
};


log.info("Import maps processing following zip files", zipPaths);

for (const zipPath of zipPaths) {
try {
const zip = await JSZip.loadAsync(await readFile(zipPath));
Expand Down Expand Up @@ -405,6 +408,8 @@ export class LocalMapsManagerService {
observer.next(progress);
}
}

log.info("Import maps done");
} catch (error: any) {
log.error(`Could not import "${zipInfo.path}"`, error);
progress.data = undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,12 @@ export function MapsPlaylistsPanel({ version, isActive }: Props) {
return playlistsManager.unlinkVersion(version);
}

const zipMimeTypes = ["application/zip", "application/zip-compressed", "application/x-zip-compressed"];
const handleFileDrop = async (files: FileList) => {
const paths: string[] = [];
for (let i = 0; i < files.length; ++i) {
const file = files[i];
if (file.type === "application/zip") {
if (zipMimeTypes.includes(file.type)) {
paths.push(file.path);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,12 @@ export const LocalMapsListPanel = forwardRef<LocalMapsListPanelRef, Props>(({ ve
return;
}

const mapsCopy = maps ? [ ...maps ] : [];
if (!maps$.value) {
setMaps(importMaps);
return;
}

const mapsCopy = [ ...maps$.value ];
for (const importMap of importMaps) {
const index = mapsCopy.findIndex(map => map.hash === importMap.hash);
if (index > -1) {
Expand Down

0 comments on commit 615ac04

Please sign in to comment.