mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-03-03 15:26: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 {
|
static Future<void> purgeTempFolder() async {
|
||||||
|
try {
|
||||||
final tempDirectory = MediaFileService.buildDirectoryPath(
|
final tempDirectory = MediaFileService.buildDirectoryPath(
|
||||||
'tmp',
|
'tmp',
|
||||||
globalApplicationSupportDirectory,
|
globalApplicationSupportDirectory,
|
||||||
|
|
@ -70,7 +71,8 @@ class MediaFileService {
|
||||||
} else {
|
} 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.
|
// 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.
|
// 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) {
|
if (group != null && !group.isDirectChat) {
|
||||||
delete = false;
|
delete = false;
|
||||||
}
|
}
|
||||||
|
|
@ -85,6 +87,9 @@ class MediaFileService {
|
||||||
file.deleteSync();
|
file.deleteSync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
Log.error(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> updateFromDB() async {
|
Future<void> updateFromDB() async {
|
||||||
|
|
|
||||||
|
|
@ -120,10 +120,6 @@ class MainCameraController {
|
||||||
}
|
}
|
||||||
|
|
||||||
selectedCameraDetails.isZoomAble = false;
|
selectedCameraDetails.isZoomAble = false;
|
||||||
if (selectedCameraDetails.cameraId != cameraId) {
|
|
||||||
// switched camera so reset the scaleFactor
|
|
||||||
selectedCameraDetails.scaleFactor = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cameraController == null) {
|
if (cameraController == null) {
|
||||||
cameraController = CameraController(
|
cameraController = CameraController(
|
||||||
|
|
@ -136,14 +132,28 @@ class MainCameraController {
|
||||||
);
|
);
|
||||||
await cameraController?.initialize();
|
await cameraController?.initialize();
|
||||||
await cameraController?.startImageStream(_processCameraImage);
|
await cameraController?.startImageStream(_processCameraImage);
|
||||||
|
await cameraController?.setZoomLevel(selectedCameraDetails.scaleFactor);
|
||||||
} else {
|
} else {
|
||||||
await HapticFeedback.lightImpact();
|
try {
|
||||||
|
if (!isVideoRecording) {
|
||||||
await cameraController?.stopImageStream();
|
await cameraController?.stopImageStream();
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
Log.info(e);
|
||||||
|
}
|
||||||
|
selectedCameraDetails.scaleFactor = 1;
|
||||||
|
|
||||||
|
await cameraController?.setZoomLevel(1);
|
||||||
await cameraController?.setDescription(gCameras[cameraId]);
|
await cameraController?.setDescription(gCameras[cameraId]);
|
||||||
|
try {
|
||||||
|
if (!isVideoRecording) {
|
||||||
await cameraController?.startImageStream(_processCameraImage);
|
await cameraController?.startImageStream(_processCameraImage);
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
Log.info(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
await cameraController?.setZoomLevel(selectedCameraDetails.scaleFactor);
|
|
||||||
await cameraController
|
await cameraController
|
||||||
?.lockCaptureOrientation(DeviceOrientation.portraitUp);
|
?.lockCaptureOrientation(DeviceOrientation.portraitUp);
|
||||||
await cameraController?.setFlashMode(
|
await cameraController?.setFlashMode(
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ import 'dart:collection';
|
||||||
|
|
||||||
import 'package:drift/drift.dart' show Value;
|
import 'package:drift/drift.dart' show Value;
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.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: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';
|
||||||
|
|
|
||||||
|
|
@ -92,8 +92,9 @@ class _MediaViewerViewState extends State<MediaViewerView> {
|
||||||
_noScreenshot.screenshotOn();
|
_noScreenshot.screenshotOn();
|
||||||
_subscription.cancel();
|
_subscription.cancel();
|
||||||
downloadStateListener?.cancel();
|
downloadStateListener?.cancel();
|
||||||
videoController?.dispose();
|
final tmp = videoController;
|
||||||
videoController = null;
|
videoController = null;
|
||||||
|
tmp?.dispose();
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
// ignore_for_file: avoid_dynamic_calls
|
// ignore_for_file: avoid_dynamic_calls
|
||||||
|
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:twonly/src/utils/keyvalue.dart';
|
import 'package:twonly/src/utils/keyvalue.dart';
|
||||||
import 'package:twonly/src/utils/misc.dart';
|
import 'package:twonly/src/utils/misc.dart';
|
||||||
|
|
@ -30,6 +31,7 @@ class _UserStudyQuestionnaireState extends State<UserStudyQuestionnaire> {
|
||||||
'comp_knowledge': null,
|
'comp_knowledge': null,
|
||||||
'security_knowledge': null,
|
'security_knowledge': null,
|
||||||
'messengers': [],
|
'messengers': [],
|
||||||
|
'is_release_mode': kReleaseMode,
|
||||||
};
|
};
|
||||||
|
|
||||||
final List<String> _messengerOptions = [
|
final List<String> _messengerOptions = [
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue