mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
[feat-75] added fix on rebasing 1
This commit is contained in:
@@ -356,6 +356,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));
|
||||
@@ -425,6 +428,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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
+5
-1
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user