mirror of
https://github.com/koodo-reader/koodo-reader.git
synced 2026-06-11 09:24:48 -04:00
feat: enhance book addition logic to support local file saving or localforage storage
This commit is contained in:
@@ -404,7 +404,11 @@ class BookUtil {
|
||||
if (!bookBuffer) {
|
||||
return false;
|
||||
}
|
||||
await this.addBook(key, format, bookBuffer);
|
||||
if (ConfigService.getReaderConfig("isUseLocal") === "yes") {
|
||||
await LocalFileManager.saveFile(key + "." + format, bookBuffer, "book");
|
||||
} else {
|
||||
await localforage.setItem(key, bookBuffer);
|
||||
}
|
||||
toast.dismiss("add-book");
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user