Disable cache when updating comic source.

This commit is contained in:
2025-09-02 20:16:13 +08:00
parent d7331f36e9
commit 9a9f539906

View File

@@ -43,7 +43,10 @@ class ComicSourcePage extends StatelessWidget {
try { try {
var res = await AppDio().get<String>( var res = await AppDio().get<String>(
source.url, source.url,
options: Options(responseType: ResponseType.plain), options: Options(
responseType: ResponseType.plain,
headers: {"cache-time": "no"},
),
); );
if (cancel) return; if (cancel) return;
controller?.close(); controller?.close();
@@ -200,10 +203,7 @@ class _BodyState extends State<_Body> {
); );
} }
void update( void update(ComicSource source, [bool showLoading = true]) {
ComicSource source, [
bool showLoading = true,
]) {
ComicSourcePage.update(source, showLoading); ComicSourcePage.update(source, showLoading);
} }
@@ -304,7 +304,10 @@ class _BodyState extends State<_Body> {
try { try {
var res = await AppDio().get<String>( var res = await AppDio().get<String>(
url, url,
options: Options(responseType: ResponseType.plain), options: Options(
responseType: ResponseType.plain,
headers: {"cache-time": "no"},
),
); );
if (cancel) return; if (cancel) return;
controller.close(); controller.close();
@@ -710,11 +713,13 @@ class _CheckUpdatesButtonState extends State<_CheckUpdatesButton> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return FilledButton.tonalIcon( return FilledButton.tonalIcon(
icon: isLoading ? SizedBox( icon: isLoading
? SizedBox(
width: 18, width: 18,
height: 18, height: 18,
child: CircularProgressIndicator(strokeWidth: 2), child: CircularProgressIndicator(strokeWidth: 2),
) : Icon(Icons.update), )
: Icon(Icons.update),
label: Text("Check updates".tl), label: Text("Check updates".tl),
onPressed: check, onPressed: check,
); );