|
|
@ -34,7 +34,7 @@ class RequestManager { |
|
|
|
try { |
|
|
|
try { |
|
|
|
subject.add( |
|
|
|
subject.add( |
|
|
|
Result( |
|
|
|
Result( |
|
|
|
unwrap(deserialize<R>(json.decode((await cache!.get(key))!))), |
|
|
|
unwrap(deserializeNextcloud<R>(json.decode((await cache!.get(key))!))), |
|
|
|
null, |
|
|
|
null, |
|
|
|
loading: true, |
|
|
|
loading: true, |
|
|
|
cached: true, |
|
|
|
cached: true, |
|
|
@ -48,7 +48,7 @@ class RequestManager { |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
final response = await (disableTimeout ? call() : timeout(call)); |
|
|
|
final response = await (disableTimeout ? call() : timeout(call)); |
|
|
|
await cache?.set(key, json.encode(serialize<R>(response))); |
|
|
|
await cache?.set(key, json.encode(serializeNextcloud<R>(response))); |
|
|
|
subject.add(Result.success(unwrap(response))); |
|
|
|
subject.add(Result.success(unwrap(response))); |
|
|
|
} catch (e, s) { |
|
|
|
} catch (e, s) { |
|
|
|
debugPrint(e.toString()); |
|
|
|
debugPrint(e.toString()); |
|
|
@ -57,7 +57,7 @@ class RequestManager { |
|
|
|
try { |
|
|
|
try { |
|
|
|
subject.add( |
|
|
|
subject.add( |
|
|
|
Result( |
|
|
|
Result( |
|
|
|
unwrap(deserialize<R>(json.decode((await cache!.get(key))!))), |
|
|
|
unwrap(deserializeNextcloud<R>(json.decode((await cache!.get(key))!))), |
|
|
|
null, |
|
|
|
null, |
|
|
|
loading: false, |
|
|
|
loading: false, |
|
|
|
cached: true, |
|
|
|
cached: true, |
|
|
|