forked from akai/readest
This commit is contained in:
@@ -14,8 +14,7 @@ interface CliArgument {
|
||||
|
||||
const parseWindowOpenWithFiles = () => {
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const filesParams = params.get('files') || '';
|
||||
const files = filesParams ? filesParams.split(',').map(decodeURIComponent) : [];
|
||||
const files = params.getAll('file');
|
||||
return files.length > 0 ? files : window.OPEN_WITH_FILES;
|
||||
};
|
||||
|
||||
|
||||
@@ -39,8 +39,9 @@ export const showReaderWindow = (appService: AppService, bookIds: string[]) => {
|
||||
};
|
||||
|
||||
export const showLibraryWindow = (appService: AppService, filenames: string[]) => {
|
||||
const files = filenames.map((file) => `${encodeURIComponent(file)}`).join(',');
|
||||
const url = `/library?files=${files}`;
|
||||
const params = new URLSearchParams();
|
||||
filenames.forEach((filename) => params.append('file', filename));
|
||||
const url = `/library?${params.toString()}`;
|
||||
createReaderWindow(appService, url);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user