Skip to content

Commit

Permalink
fix(nc): fix login error if folder already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
adil192 committed Sep 29, 2023
1 parent a06f283 commit 9355d9e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/data/nextcloud/nextcloud_client_extension.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import 'dart:convert';
import 'dart:io';
import 'dart:typed_data';

import 'package:crypto/crypto.dart';
Expand Down Expand Up @@ -70,7 +70,11 @@ extension NextcloudClientExtension on NextcloudClient {
Future<void> setConfig(Map<String, String> config) async {
String json = jsonEncode(config);
Uint8List file = Uint8List.fromList(json.codeUnits);
await webdav.mkcol(Uri.parse(appRootDirectoryPrefix));
try {
await webdav.mkcol(Uri.parse(appRootDirectoryPrefix));
} on DynamiteApiException catch (e) {
if (e.statusCode != HttpStatus.methodNotAllowed) rethrow;
}
await webdav.put(file, configFileUri);
}

Expand Down

0 comments on commit 9355d9e

Please sign in to comment.