improved performance and battery usage on older devices
This commit is contained in:
@@ -30,6 +30,10 @@ abstract class TalkApi<T extends ApiResponse?> {
|
||||
);
|
||||
T assemble(String raw);
|
||||
|
||||
/// Override to parse large payloads off the UI isolate (e.g. via `compute`
|
||||
/// with a top-level parser); defaults to the synchronous [assemble].
|
||||
Future<T> assembleAsync(String raw) async => assemble(raw);
|
||||
|
||||
Future<T> run() async {
|
||||
final endpoint = NextcloudOcs.uri(
|
||||
'apps/spreed/api/$path',
|
||||
@@ -69,7 +73,7 @@ abstract class TalkApi<T extends ApiResponse?> {
|
||||
}
|
||||
|
||||
try {
|
||||
final assembled = assemble(data.body);
|
||||
final assembled = await assembleAsync(data.body);
|
||||
assembled?.headers = data.headers;
|
||||
return assembled;
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user