added auth to pictrs upload
This commit is contained in:
parent
c3914d1484
commit
579d613caa
|
@ -79,13 +79,15 @@ class CreatePost extends HookWidget {
|
||||||
if (pic != null) {
|
if (pic != null) {
|
||||||
imageUploadLoading.value = true;
|
imageUploadLoading.value = true;
|
||||||
|
|
||||||
|
final token = accStore.defaultTokenFor(selectedInstance.value);
|
||||||
final pictrs = LemmyApi(selectedInstance.value).pictrs;
|
final pictrs = LemmyApi(selectedInstance.value).pictrs;
|
||||||
final upload = await pictrs.upload(pic.path);
|
final upload =
|
||||||
|
await pictrs.upload(filePath: pic.path, auth: token.raw);
|
||||||
pictrsDeleteToken.value = upload.files[0];
|
pictrsDeleteToken.value = upload.files[0];
|
||||||
urlController.text =
|
urlController.text =
|
||||||
pathToPictrs(selectedInstance.value, upload.files[0].file);
|
pathToPictrs(selectedInstance.value, upload.files[0].file);
|
||||||
}
|
}
|
||||||
|
print(urlController.text);
|
||||||
// ignore: avoid_catches_without_on_clauses
|
// ignore: avoid_catches_without_on_clauses
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
scaffoldKey.currentState
|
scaffoldKey.currentState
|
||||||
|
|
Loading…
Reference in New Issue