Formatting and Consolidate Image Check
continuous-integration/drone/pr Build is pending
Details
continuous-integration/drone/pr Build is pending
Details
This commit is contained in:
parent
4ea0d4261c
commit
6ba6f76ee1
|
@ -404,9 +404,12 @@ class Settings extends ChangeNotifier {
|
|||
// checks experiment settings and file extension for image previews
|
||||
// (ignores file size; if the user manually accepts the file, assume it's okay to preview)
|
||||
bool shouldPreview(String path) {
|
||||
return isExperimentEnabled(ImagePreviewsExperiment) && isImage(path);
|
||||
}
|
||||
|
||||
bool isImage(String path) {
|
||||
var lpath = path.toLowerCase();
|
||||
return isExperimentEnabled(ImagePreviewsExperiment) &&
|
||||
(lpath.endsWith(".jpg") || lpath.endsWith(".jpeg") || lpath.endsWith(".png") || lpath.endsWith(".gif") || lpath.endsWith(".webp") || lpath.endsWith(".bmp"));
|
||||
return (lpath.endsWith(".jpg") || lpath.endsWith(".jpeg") || lpath.endsWith(".png") || lpath.endsWith(".gif") || lpath.endsWith(".webp") || lpath.endsWith(".bmp"));
|
||||
}
|
||||
|
||||
String get downloadPath => _downloadPath;
|
||||
|
|
|
@ -94,10 +94,7 @@ class FileBubbleState extends State<FileBubble> {
|
|||
|
||||
var isImagePreview = false;
|
||||
if (path != null) {
|
||||
var lpath = path.toLowerCase();
|
||||
if (lpath.endsWith(".jpg") || lpath.endsWith(".jpeg") || lpath.endsWith(".png") || lpath.endsWith(".gif") || lpath.endsWith(".webp") || lpath.endsWith(".bmp")) {
|
||||
isImagePreview = true;
|
||||
}
|
||||
isImagePreview = Provider.of<Settings>(context).isImage(path);
|
||||
}
|
||||
|
||||
if (downloadComplete && path != null) {
|
||||
|
|
Loading…
Reference in New Issue