Browse Source

fix(nextcloud,neon_files): Do not require client for toWebDavFiles

pull/525/head
jld3103 1 year ago
parent
commit
678ed004a3
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 2
      packages/neon/neon_files/lib/blocs/browser.dart
  2. 2
      packages/nextcloud/lib/src/webdav/file.dart
  3. 4
      packages/nextcloud/test/webdav_test.dart

2
packages/neon/neon_files/lib/blocs/browser.dart

@ -56,7 +56,7 @@ class FilesBrowserBloc extends InteractiveBloc implements FilesBrowserBlocEvents
), ),
depth: '1', depth: '1',
), ),
(final response) => response.toWebDavFiles(client.webdav).sublist(1), (final response) => response.toWebDavFiles().sublist(1),
emitEmptyCache: true, emitEmptyCache: true,
); );
} }

2
packages/nextcloud/lib/src/webdav/file.dart

@ -5,7 +5,7 @@ import 'package:nextcloud/src/webdav/webdav.dart';
// ignore: public_member_api_docs // ignore: public_member_api_docs
extension WebDavMultistatusFile on WebDavMultistatus { extension WebDavMultistatusFile on WebDavMultistatus {
/// Convert the [WebDavMultistatus] into a [WebDavFile] for easier handling /// Convert the [WebDavMultistatus] into a [WebDavFile] for easier handling
List<WebDavFile> toWebDavFiles(final WebDavClient client) => responses List<WebDavFile> toWebDavFiles() => responses
.where((final response) => response.href != null) .where((final response) => response.href != null)
.map((final response) => WebDavFile(response: response)) .map((final response) => WebDavFile(response: response))
.toList(); .toList();

4
packages/nextcloud/test/webdav_test.dart

@ -85,7 +85,7 @@ void main() {
ocmsharepermissions: true, ocmsharepermissions: true,
), ),
)) ))
.toWebDavFiles(client.webdav) .toWebDavFiles()
.single; .single;
expect(response.path, '/Nextcloud.png'); expect(response.path, '/Nextcloud.png');
@ -150,7 +150,7 @@ void main() {
), ),
depth: '0', depth: '0',
)) ))
.toWebDavFiles(client.webdav) .toWebDavFiles()
.single; .single;
expect(response.path, '/test/'); expect(response.path, '/test/');

Loading…
Cancel
Save