mirror of
https://github.com/tachiyomiorg/tachiyomi-extensions-inspector.git
synced 2025-01-12 08:49:08 +01:00
fix some bugs
This commit is contained in:
parent
9151034fbc
commit
ce545b1fd5
@ -1,9 +1,12 @@
|
|||||||
package ir.armor.tachidesk.util
|
package ir.armor.tachidesk.util
|
||||||
|
|
||||||
import ir.armor.tachidesk.database.dataclass.MangaDataClass
|
import ir.armor.tachidesk.database.dataclass.MangaDataClass
|
||||||
|
import ir.armor.tachidesk.database.table.CategoryMangaTable
|
||||||
import ir.armor.tachidesk.database.table.MangaTable
|
import ir.armor.tachidesk.database.table.MangaTable
|
||||||
import ir.armor.tachidesk.database.table.toDataClass
|
import ir.armor.tachidesk.database.table.toDataClass
|
||||||
|
import org.jetbrains.exposed.sql.SqlExpressionBuilder.eq
|
||||||
import org.jetbrains.exposed.sql.and
|
import org.jetbrains.exposed.sql.and
|
||||||
|
import org.jetbrains.exposed.sql.deleteWhere
|
||||||
import org.jetbrains.exposed.sql.select
|
import org.jetbrains.exposed.sql.select
|
||||||
import org.jetbrains.exposed.sql.transactions.transaction
|
import org.jetbrains.exposed.sql.transactions.transaction
|
||||||
import org.jetbrains.exposed.sql.update
|
import org.jetbrains.exposed.sql.update
|
||||||
@ -29,7 +32,9 @@ fun removeMangaFromLibrary(mangaId: Int) {
|
|||||||
transaction {
|
transaction {
|
||||||
MangaTable.update({ MangaTable.id eq manga.id }) {
|
MangaTable.update({ MangaTable.id eq manga.id }) {
|
||||||
it[inLibrary] = false
|
it[inLibrary] = false
|
||||||
|
it[defaultCategory] = true
|
||||||
}
|
}
|
||||||
|
CategoryMangaTable.deleteWhere { CategoryMangaTable.manga eq mangaId }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ export default function CategorySelect(props: IProps) {
|
|||||||
setCategoryInfos(tmpCategoryInfos);
|
setCategoryInfos(tmpCategoryInfos);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}, [updateTriggerHolder]);
|
}, [updateTriggerHolder, open]);
|
||||||
|
|
||||||
const handleCancel = () => {
|
const handleCancel = () => {
|
||||||
setOpen(false);
|
setOpen(false);
|
||||||
@ -90,7 +90,6 @@ export default function CategorySelect(props: IProps) {
|
|||||||
<Checkbox
|
<Checkbox
|
||||||
checked={categoryInfo.selected}
|
checked={categoryInfo.selected}
|
||||||
onChange={(e) => handleChange(e, categoryInfo.category.id)}
|
onChange={(e) => handleChange(e, categoryInfo.category.id)}
|
||||||
name="checkedB"
|
|
||||||
color="default"
|
color="default"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
@ -26,7 +26,7 @@ export default function MangaDetails(props: IProps) {
|
|||||||
const [inLibrary, setInLibrary] = useState<string>(
|
const [inLibrary, setInLibrary] = useState<string>(
|
||||||
manga.inLibrary ? 'In Library' : 'Not In Library',
|
manga.inLibrary ? 'In Library' : 'Not In Library',
|
||||||
);
|
);
|
||||||
const [categoryDialogOpen, setCategoryDialogOpen] = useState<boolean>(true);
|
const [categoryDialogOpen, setCategoryDialogOpen] = useState<boolean>(false);
|
||||||
|
|
||||||
function addToLibrary() {
|
function addToLibrary() {
|
||||||
setInLibrary('adding');
|
setInLibrary('adding');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user