mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 10:38:41 +00:00
fix #319
This commit is contained in:
parent
c6cc518de1
commit
004c0e116c
1 changed files with 11 additions and 4 deletions
|
|
@ -6,7 +6,6 @@ import 'package:drift/drift.dart' show Value;
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
import 'package:hashlib/random.dart';
|
|
||||||
import 'package:screenshot/screenshot.dart';
|
import 'package:screenshot/screenshot.dart';
|
||||||
import 'package:twonly/globals.dart';
|
import 'package:twonly/globals.dart';
|
||||||
import 'package:twonly/src/database/daos/contacts.dao.dart';
|
import 'package:twonly/src/database/daos/contacts.dao.dart';
|
||||||
|
|
@ -431,9 +430,17 @@ class _ShareImageEditorView extends State<ShareImageEditorView> {
|
||||||
|
|
||||||
// In case the image was already stored, then rename the stored image.
|
// In case the image was already stored, then rename the stored image.
|
||||||
if (mediaService.storedPath.existsSync()) {
|
if (mediaService.storedPath.existsSync()) {
|
||||||
final newPath = mediaService.storedPath.absolute.path
|
final mediaFile = await twonlyDB.mediaFilesDao.insertMedia(
|
||||||
.replaceFirst(media.mediaId, uuid.v7());
|
MediaFilesCompanion(
|
||||||
mediaService.storedPath.renameSync(newPath);
|
type: Value(mediaService.mediaFile.type),
|
||||||
|
createdAt: Value(DateTime.now()),
|
||||||
|
stored: const Value(true),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
if (mediaFile != null) {
|
||||||
|
mediaService.storedPath
|
||||||
|
.renameSync(MediaFileService(mediaFile).storedPath.path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue