mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-03-03 15:46:47 +00:00
small bug fixes
This commit is contained in:
parent
fa767977dd
commit
f93a337aa9
5 changed files with 77 additions and 60 deletions
|
|
@ -24,6 +24,7 @@ class MediaFileService {
|
|||
}
|
||||
|
||||
static Future<void> purgeTempFolder() async {
|
||||
try {
|
||||
final tempDirectory = MediaFileService.buildDirectoryPath(
|
||||
'tmp',
|
||||
globalApplicationSupportDirectory,
|
||||
|
|
@ -70,7 +71,8 @@ class MediaFileService {
|
|||
} else {
|
||||
// Check weather the image was send in a group. Then the images is preserved for two days in case another person stores the image.
|
||||
// This also allows to reopen this image for two days.
|
||||
final group = await twonlyDB.groupsDao.getGroup(message.groupId);
|
||||
final group =
|
||||
await twonlyDB.groupsDao.getGroup(message.groupId);
|
||||
if (group != null && !group.isDirectChat) {
|
||||
delete = false;
|
||||
}
|
||||
|
|
@ -85,6 +87,9 @@ class MediaFileService {
|
|||
file.deleteSync();
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
Log.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> updateFromDB() async {
|
||||
|
|
|
|||
|
|
@ -120,10 +120,6 @@ class MainCameraController {
|
|||
}
|
||||
|
||||
selectedCameraDetails.isZoomAble = false;
|
||||
if (selectedCameraDetails.cameraId != cameraId) {
|
||||
// switched camera so reset the scaleFactor
|
||||
selectedCameraDetails.scaleFactor = 1;
|
||||
}
|
||||
|
||||
if (cameraController == null) {
|
||||
cameraController = CameraController(
|
||||
|
|
@ -136,14 +132,28 @@ class MainCameraController {
|
|||
);
|
||||
await cameraController?.initialize();
|
||||
await cameraController?.startImageStream(_processCameraImage);
|
||||
await cameraController?.setZoomLevel(selectedCameraDetails.scaleFactor);
|
||||
} else {
|
||||
await HapticFeedback.lightImpact();
|
||||
try {
|
||||
if (!isVideoRecording) {
|
||||
await cameraController?.stopImageStream();
|
||||
}
|
||||
} catch (e) {
|
||||
Log.info(e);
|
||||
}
|
||||
selectedCameraDetails.scaleFactor = 1;
|
||||
|
||||
await cameraController?.setZoomLevel(1);
|
||||
await cameraController?.setDescription(gCameras[cameraId]);
|
||||
try {
|
||||
if (!isVideoRecording) {
|
||||
await cameraController?.startImageStream(_processCameraImage);
|
||||
}
|
||||
} catch (e) {
|
||||
Log.info(e);
|
||||
}
|
||||
}
|
||||
|
||||
await cameraController?.setZoomLevel(selectedCameraDetails.scaleFactor);
|
||||
await cameraController
|
||||
?.lockCaptureOrientation(DeviceOrientation.portraitUp);
|
||||
await cameraController?.setFlashMode(
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import 'dart:collection';
|
|||
|
||||
import 'package:drift/drift.dart' show Value;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:twonly/globals.dart';
|
||||
import 'package:twonly/src/database/daos/contacts.dao.dart';
|
||||
|
|
|
|||
|
|
@ -92,8 +92,9 @@ class _MediaViewerViewState extends State<MediaViewerView> {
|
|||
_noScreenshot.screenshotOn();
|
||||
_subscription.cancel();
|
||||
downloadStateListener?.cancel();
|
||||
videoController?.dispose();
|
||||
final tmp = videoController;
|
||||
videoController = null;
|
||||
tmp?.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
// ignore_for_file: avoid_dynamic_calls
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:twonly/src/utils/keyvalue.dart';
|
||||
import 'package:twonly/src/utils/misc.dart';
|
||||
|
|
@ -30,6 +31,7 @@ class _UserStudyQuestionnaireState extends State<UserStudyQuestionnaire> {
|
|||
'comp_knowledge': null,
|
||||
'security_knowledge': null,
|
||||
'messengers': [],
|
||||
'is_release_mode': kReleaseMode,
|
||||
};
|
||||
|
||||
final List<String> _messengerOptions = [
|
||||
|
|
|
|||
Loading…
Reference in a new issue