From 918d00123e75425355976d2ecaa635dbfb1e54a3 Mon Sep 17 00:00:00 2001 From: Neeraj Gupta <254676+ua741@users.noreply.github.com> Date: Sun, 6 Nov 2022 11:59:16 +0530 Subject: [PATCH 1/6] Add Github action to run lint check --- .github/workflows/code_quality.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/code_quality.yml diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code_quality.yml new file mode 100644 index 000000000..91502691f --- /dev/null +++ b/.github/workflows/code_quality.yml @@ -0,0 +1,29 @@ +name: Check Linter Rules +on: + pull_request: + branches: + - master +jobs: + test: + name: Check the source code + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + # Setup the flutter environment. + - uses: subosito/flutter-action@v2.3.0 + with: + channel: 'stable' + flutter-version: '3.0.0' + + # Fetch sub modules + - run: git submodule update --init --recursive + + # Get flutter dependencies. + - name: Install packages + run: flutter pub get + + - name: Run Linter + run: flutter analyze +# - name: Run Test :sed: +# run: flutter test From 19cc54f422cc2859ffe8a4a79fc7c687d6d46190 Mon Sep 17 00:00:00 2001 From: Neeraj Gupta <254676+ua741@users.noreply.github.com> Date: Sun, 6 Nov 2022 13:52:54 +0530 Subject: [PATCH 2/6] Fix lint issues --- analysis_options.yaml | 1 + lib/core/network.dart | 6 +- lib/db/files_db.dart | 3 +- lib/models/file.dart | 4 +- lib/services/local/local_sync_util.dart | 6 +- lib/services/remote_sync_service.dart | 12 +- lib/ui/account/recovery_key_page.dart | 254 ++++++++++--------- lib/ui/home/home_bottom_nav_bar.dart | 6 +- lib/ui/home_widget.dart | 3 +- lib/ui/huge_listview/huge_listview.dart | 2 +- lib/ui/payment/stripe_subscription_page.dart | 2 - lib/ui/settings/app_version_widget.dart | 1 - lib/ui/viewer/file/fading_app_bar.dart | 5 +- lib/utils/exif_util.dart | 20 +- lib/utils/file_uploader.dart | 3 +- 15 files changed, 172 insertions(+), 156 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index 0537fc253..0c9cce807 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -58,6 +58,7 @@ analyzer: unnecessary_const: error cancel_subscriptions: error + invalid_dependency: info use_build_context_synchronously: ignore # experimental lint, requires many changes prefer_interpolation_to_compose_strings: ignore # later too many warnings prefer_double_quotes: ignore # too many warnings diff --git a/lib/core/network.dart b/lib/core/network.dart index eb83f8175..0d396e5d7 100644 --- a/lib/core/network.dart +++ b/lib/core/network.dart @@ -66,8 +66,10 @@ class EnteRequestInterceptor extends Interceptor { @override void onRequest(RequestOptions options, RequestInterceptorHandler handler) { if (kDebugMode) { - assert(options.baseUrl == Network.apiEndpoint, - "interceptor should only be used for API endpoint"); + assert( + options.baseUrl == Network.apiEndpoint, + "interceptor should only be used for API endpoint", + ); } // ignore: prefer_const_constructors options.headers.putIfAbsent("x-request-id", () => Uuid().v4().toString()); diff --git a/lib/db/files_db.dart b/lib/db/files_db.dart index 3e2576673..be292fcf1 100644 --- a/lib/db/files_db.dart +++ b/lib/db/files_db.dart @@ -1261,7 +1261,8 @@ class FilesDB { } Future>> getAllFilesGroupByCollectionID( - List ids) async { + List ids, + ) async { final result = >{}; if (ids.isEmpty) { return result; diff --git a/lib/models/file.dart b/lib/models/file.dart index b48082d20..a620ed090 100644 --- a/lib/models/file.dart +++ b/lib/models/file.dart @@ -161,9 +161,9 @@ class File extends EnteFile { duration = asset.duration; } } - if (fileType == FileType.image) { + if (fileType == FileType.image && mediaUploadData.sourceFile != null) { final exifTime = - await getCreationTimeFromEXIF(mediaUploadData.sourceFile); + await getCreationTimeFromEXIF(mediaUploadData.sourceFile!); if (exifTime != null) { creationTime = exifTime.microsecondsSinceEpoch; } diff --git a/lib/services/local/local_sync_util.dart b/lib/services/local/local_sync_util.dart index 76c5997a4..b3f8e6ac6 100644 --- a/lib/services/local/local_sync_util.dart +++ b/lib/services/local/local_sync_util.dart @@ -264,8 +264,10 @@ Future> _getAllAssetLists(AssetPathEntity pathEntity) async { size: assetFetchPageSize, ); Bus.instance.fire( - LocalImportProgressEvent(pathEntity.name, - currentPage * assetFetchPageSize + currentPageResult.length), + LocalImportProgressEvent( + pathEntity.name, + currentPage * assetFetchPageSize + currentPageResult.length, + ), ); result.addAll(currentPageResult); currentPage = currentPage + 1; diff --git a/lib/services/remote_sync_service.dart b/lib/services/remote_sync_service.dart index 5b1f3195c..8c0314800 100644 --- a/lib/services/remote_sync_service.dart +++ b/lib/services/remote_sync_service.dart @@ -360,16 +360,20 @@ class RemoteSyncService { if (pendingUploads.isEmpty) { continue; } else { - _logger.info("RemovingFiles $collectionIDs: pendingUploads " - "${pendingUploads.length}"); + _logger.info( + "RemovingFiles $collectionIDs: pendingUploads " + "${pendingUploads.length}", + ); } final Set localIDsInOtherFileEntries = await _db.getLocalIDsPresentInEntries( pendingUploads, collectionID, ); - _logger.info("RemovingFiles $collectionIDs: filesInOtherCollection " - "${localIDsInOtherFileEntries.length}"); + _logger.info( + "RemovingFiles $collectionIDs: filesInOtherCollection " + "${localIDsInOtherFileEntries.length}", + ); final List entriesToUpdate = []; final List entriesToDelete = []; for (File pendingUpload in pendingUploads) { diff --git a/lib/ui/account/recovery_key_page.dart b/lib/ui/account/recovery_key_page.dart index e5b561a24..7990d078f 100644 --- a/lib/ui/account/recovery_key_page.dart +++ b/lib/ui/account/recovery_key_page.dart @@ -63,142 +63,148 @@ class _RecoveryKeyPageState extends State { : 120; return Scaffold( - appBar: widget.showProgressBar - ? AppBar( - elevation: 0, - title: Hero( - tag: "recovery_key", - child: StepProgressIndicator( - totalSteps: 4, - currentStep: 3, - selectedColor: - Theme.of(context).colorScheme.greenAlternative, - roundedEdges: const Radius.circular(10), - unselectedColor: Theme.of(context) - .colorScheme - .stepProgressUnselectedColor, - ), + appBar: widget.showProgressBar + ? AppBar( + elevation: 0, + title: Hero( + tag: "recovery_key", + child: StepProgressIndicator( + totalSteps: 4, + currentStep: 3, + selectedColor: Theme.of(context).colorScheme.greenAlternative, + roundedEdges: const Radius.circular(10), + unselectedColor: + Theme.of(context).colorScheme.stepProgressUnselectedColor, ), - ) - : widget.showAppBar - ? AppBar( - elevation: 0, - title: Text(widget.title ?? "Recovery key"), - ) - : null, - body: Padding( - padding: EdgeInsets.fromLTRB(20, topPadding, 20, 20), - child: LayoutBuilder( - builder: (context, constraints) { - return SingleChildScrollView( - child: ConstrainedBox( - constraints: BoxConstraints( - minWidth: constraints.maxWidth, - minHeight: constraints.maxHeight), - child: IntrinsicHeight( - child: Column( - mainAxisSize: MainAxisSize.max, - children: [ - widget.showAppBar - ? const SizedBox.shrink() - : Text( - widget.title ?? "Recovery key", - style: Theme.of(context).textTheme.headline4, - ), - Padding( - padding: - EdgeInsets.all(widget.showAppBar ? 0 : 12)), - Text( - widget.text ?? - "If you forget your password, the only way you can recover your data is with this key.", - style: Theme.of(context).textTheme.subtitle1, - ), - const Padding(padding: EdgeInsets.only(top: 24)), - DottedBorder( - color: const Color.fromRGBO(17, 127, 56, 1), - //color of dotted/dash line - strokeWidth: 1, - //thickness of dash/dots - dashPattern: const [6, 6], - radius: const Radius.circular(8), - //dash patterns, 10 is dash width, 6 is space width - child: SizedBox( - //inner container - // height: 120, //height of inner container - width: double - .infinity, //width to 100% match to parent container. - // ignore: prefer_const_literals_to_create_immutables - child: Column( - children: [ - GestureDetector( - onTap: () async { - await Clipboard.setData( - ClipboardData(text: recoveryKey), - ); - showToast(context, - "Recovery key copied to clipboard"); - setState(() { - _hasTriedToSave = true; - }); - }, - child: Container( - decoration: BoxDecoration( - border: Border.all( - color: const Color.fromRGBO( - 49, 155, 86, .2), + ), + ) + : widget.showAppBar + ? AppBar( + elevation: 0, + title: Text(widget.title ?? "Recovery key"), + ) + : null, + body: Padding( + padding: EdgeInsets.fromLTRB(20, topPadding, 20, 20), + child: LayoutBuilder( + builder: (context, constraints) { + return SingleChildScrollView( + child: ConstrainedBox( + constraints: BoxConstraints( + minWidth: constraints.maxWidth, + minHeight: constraints.maxHeight, + ), + child: IntrinsicHeight( + child: Column( + mainAxisSize: MainAxisSize.max, + children: [ + widget.showAppBar + ? const SizedBox.shrink() + : Text( + widget.title ?? "Recovery key", + style: Theme.of(context).textTheme.headline4, + ), + Padding( + padding: EdgeInsets.all(widget.showAppBar ? 0 : 12), + ), + Text( + widget.text ?? + "If you forget your password, the only way you can recover your data is with this key.", + style: Theme.of(context).textTheme.subtitle1, + ), + const Padding(padding: EdgeInsets.only(top: 24)), + DottedBorder( + color: const Color.fromRGBO(17, 127, 56, 1), + //color of dotted/dash line + strokeWidth: 1, + //thickness of dash/dots + dashPattern: const [6, 6], + radius: const Radius.circular(8), + //dash patterns, 10 is dash width, 6 is space width + child: SizedBox( + //inner container + // height: 120, //height of inner container + width: double + .infinity, //width to 100% match to parent container. + // ignore: prefer_const_literals_to_create_immutables + child: Column( + children: [ + GestureDetector( + onTap: () async { + await Clipboard.setData( + ClipboardData(text: recoveryKey), + ); + showToast( + context, + "Recovery key copied to clipboard", + ); + setState(() { + _hasTriedToSave = true; + }); + }, + child: Container( + decoration: BoxDecoration( + border: Border.all( + color: const Color.fromRGBO( + 49, + 155, + 86, + .2, ), - borderRadius: const BorderRadius.all( - Radius.circular(2), - ), - color: Theme.of(context) - .colorScheme - .recoveryKeyBoxColor, ), - padding: const EdgeInsets.all(20), - width: double.infinity, - child: Text( - recoveryKey, - style: - Theme.of(context).textTheme.bodyText1, + borderRadius: const BorderRadius.all( + Radius.circular(2), ), + color: Theme.of(context) + .colorScheme + .recoveryKeyBoxColor, + ), + padding: const EdgeInsets.all(20), + width: double.infinity, + child: Text( + recoveryKey, + style: + Theme.of(context).textTheme.bodyText1, ), ), - ], - ), + ), + ], ), ), - SizedBox( - height: 80, + ), + SizedBox( + height: 80, + width: double.infinity, + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 20), + child: Text( + widget.subText ?? + "We don’t store this key, please save this in a safe place.", + style: Theme.of(context).textTheme.bodyText1, + ), + ), + ), + Expanded( + child: Container( + alignment: Alignment.bottomCenter, width: double.infinity, - child: Padding( - padding: const EdgeInsets.symmetric(vertical: 20), - child: Text( - widget.subText ?? - "We don’t store this key, please save this in a safe place.", - style: Theme.of(context).textTheme.bodyText1, - ), + padding: const EdgeInsets.fromLTRB(10, 10, 10, 42), + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: _saveOptions(context, recoveryKey), ), ), - Expanded( - child: Container( - alignment: Alignment.bottomCenter, - width: double.infinity, - padding: const EdgeInsets.fromLTRB(10, 10, 10, 42), - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - crossAxisAlignment: CrossAxisAlignment.stretch, - children: _saveOptions(context, recoveryKey), - ), - ), - ) - ], - ), // columnEnds - ), + ) + ], + ), // columnEnds ), - ); - }, - ), - )); + ), + ); + }, + ), + ), + ); } List _saveOptions(BuildContext context, String recoveryKey) { diff --git a/lib/ui/home/home_bottom_nav_bar.dart b/lib/ui/home/home_bottom_nav_bar.dart index 554160c5d..2ec79c802 100644 --- a/lib/ui/home/home_bottom_nav_bar.dart +++ b/lib/ui/home/home_bottom_nav_bar.dart @@ -41,8 +41,10 @@ class _HomeBottomNavigationBarState extends State { _tabChangedEventSubscription = Bus.instance.on().listen((event) { if (event.source != TabChangedEventSource.tabBar) { - debugPrint('${(TabChangedEvent).toString()} index changed from ' - '$currentTabIndex to ${event.selectedIndex} via ${event.source}'); + debugPrint( + '${(TabChangedEvent).toString()} index changed from ' + '$currentTabIndex to ${event.selectedIndex} via ${event.source}', + ); if (mounted) { setState(() { currentTabIndex = event.selectedIndex; diff --git a/lib/ui/home_widget.dart b/lib/ui/home_widget.dart index 9ae605e4f..eb85a9ae2 100644 --- a/lib/ui/home_widget.dart +++ b/lib/ui/home_widget.dart @@ -89,7 +89,8 @@ class _HomeWidgetState extends State { Bus.instance.on().listen((event) { if (event.source != TabChangedEventSource.pageView) { debugPrint( - "TabChange going from $_selectedTabIndex to ${event.selectedIndex} souce: ${event.source}"); + "TabChange going from $_selectedTabIndex to ${event.selectedIndex} souce: ${event.source}", + ); _selectedTabIndex = event.selectedIndex; // _pageController.jumpToPage(_selectedTabIndex); _pageController.animateToPage( diff --git a/lib/ui/huge_listview/huge_listview.dart b/lib/ui/huge_listview/huge_listview.dart index 3bd8abf3a..9bb16cf18 100644 --- a/lib/ui/huge_listview/huge_listview.dart +++ b/lib/ui/huge_listview/huge_listview.dart @@ -1,6 +1,6 @@ // @dart=2.9 -import 'dart:math' show max, min; +import 'dart:math' show max; import 'package:flutter/material.dart'; import 'package:photos/ui/huge_listview/draggable_scrollbar.dart'; diff --git a/lib/ui/payment/stripe_subscription_page.dart b/lib/ui/payment/stripe_subscription_page.dart index a56b02498..f4b85d413 100644 --- a/lib/ui/payment/stripe_subscription_page.dart +++ b/lib/ui/payment/stripe_subscription_page.dart @@ -3,7 +3,6 @@ import 'dart:async'; import 'package:flutter/material.dart'; -import 'package:logging/logging.dart'; import 'package:photos/ente_theme_data.dart'; import 'package:photos/models/billing_plan.dart'; import 'package:photos/models/subscription.dart'; @@ -38,7 +37,6 @@ class StripeSubscriptionPage extends StatefulWidget { } class _StripeSubscriptionPageState extends State { - final _logger = Logger("StripeSubscriptionPage"); final _billingService = BillingService.instance; final _userService = UserService.instance; Subscription _currentSubscription; diff --git a/lib/ui/settings/app_version_widget.dart b/lib/ui/settings/app_version_widget.dart index ac9f36b0f..a991dafad 100644 --- a/lib/ui/settings/app_version_widget.dart +++ b/lib/ui/settings/app_version_widget.dart @@ -15,7 +15,6 @@ class AppVersionWidget extends StatefulWidget { class _AppVersionWidgetState extends State { static const kTapThresholdForInspector = 5; static const kConsecutiveTapTimeWindowInMilliseconds = 2000; - static const kDummyDelayDurationInMilliseconds = 1500; int _lastTap; int _consecutiveTaps = 0; diff --git a/lib/ui/viewer/file/fading_app_bar.dart b/lib/ui/viewer/file/fading_app_bar.dart index 274153953..39bd20800 100644 --- a/lib/ui/viewer/file/fading_app_bar.dart +++ b/lib/ui/viewer/file/fading_app_bar.dart @@ -471,7 +471,10 @@ class FadingAppBarState extends State { } Future _saveLivePhotoOnDroid( - io.File image, io.File video, File enteFile) async { + io.File image, + io.File video, + File enteFile, + ) async { debugPrint("Downloading LivePhoto on Droid"); AssetEntity savedAsset = await PhotoManager.editor .saveImageWithPath(image.path, title: enteFile.title); diff --git a/lib/utils/exif_util.dart b/lib/utils/exif_util.dart index dd1eff63e..3a284f067 100644 --- a/lib/utils/exif_util.dart +++ b/lib/utils/exif_util.dart @@ -1,5 +1,3 @@ -// @dart=2.9 - import 'dart:io' as io; import 'package:exif/exif.dart'; @@ -29,18 +27,16 @@ Future> getExif(File file) async { } } -Future getCreationTimeFromEXIF(io.File file) async { +Future getCreationTimeFromEXIF(io.File file) async { try { final exif = await readExifFromFile(file); - if (exif != null) { - final exifTime = exif.containsKey(kDateTimeOriginal) - ? exif[kDateTimeOriginal].printable - : exif.containsKey(kImageDateTime) - ? exif[kImageDateTime].printable - : null; - if (exifTime != null && exifTime != kEmptyExifDateTime) { - return DateFormat(kExifDateTimePattern).parse(exifTime); - } + final exifTime = exif.containsKey(kDateTimeOriginal) + ? exif[kDateTimeOriginal]!.printable + : exif.containsKey(kImageDateTime) + ? exif[kImageDateTime]!.printable + : null; + if (exifTime != null && exifTime != kEmptyExifDateTime) { + return DateFormat(kExifDateTimePattern).parse(exifTime); } } catch (e) { _logger.severe("failed to getCreationTimeFromEXIF", e); diff --git a/lib/utils/file_uploader.dart b/lib/utils/file_uploader.dart index 9869f99f3..d71f17dfc 100644 --- a/lib/utils/file_uploader.dart +++ b/lib/utils/file_uploader.dart @@ -188,7 +188,8 @@ class FileUploader { _queue.remove(id).completer.completeError(reason); } _logger.info( - 'number of enteries removed from queue ${uploadsToBeRemoved.length}'); + 'number of enteries removed from queue ${uploadsToBeRemoved.length}', + ); _totalCountInUploadSession -= uploadsToBeRemoved.length; } From f054293b9d94c00eea042634a6d199b742b64d4b Mon Sep 17 00:00:00 2001 From: Neeraj Gupta <254676+ua741@users.noreply.github.com> Date: Sun, 6 Nov 2022 13:53:50 +0530 Subject: [PATCH 3/6] Lint: treat info as non-fatal errors --- .github/workflows/code_quality.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code_quality.yml index 91502691f..42167df04 100644 --- a/.github/workflows/code_quality.yml +++ b/.github/workflows/code_quality.yml @@ -24,6 +24,6 @@ jobs: run: flutter pub get - name: Run Linter - run: flutter analyze + run: flutter analyze --no-fatal-infos # - name: Run Test :sed: # run: flutter test From b70ad80bd8cce7f93d4541a1dc9de703319960c3 Mon Sep 17 00:00:00 2001 From: Neeraj Gupta <254676+ua741@users.noreply.github.com> Date: Sun, 6 Nov 2022 13:58:13 +0530 Subject: [PATCH 4/6] GithubAction: Use cached flutter --- .github/workflows/code_quality.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code_quality.yml index 42167df04..b123a4ebe 100644 --- a/.github/workflows/code_quality.yml +++ b/.github/workflows/code_quality.yml @@ -9,7 +9,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - + - uses: actions/cache@v2 + with: + path: ${{ runner.tool_cache }}/flutter + key: flutter-3.0.0-stable # Setup the flutter environment. - uses: subosito/flutter-action@v2.3.0 with: From 139e3c78355838b160480f9f61378ca7d1f32cd5 Mon Sep 17 00:00:00 2001 From: Neeraj Gupta <254676+ua741@users.noreply.github.com> Date: Sun, 6 Nov 2022 14:04:06 +0530 Subject: [PATCH 5/6] Fix prefer_final_locals warnings --- analysis_options.yaml | 1 + lib/db/files_db.dart | 2 +- lib/ui/home/home_gallery_widget.dart | 2 +- lib/ui/viewer/file/fading_app_bar.dart | 2 +- lib/ui/viewer/file/fading_bottom_bar.dart | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index 0c9cce807..495c8fd15 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -55,6 +55,7 @@ analyzer: prefer_const_constructors: warning prefer_const_declarations: warning prefer_const_constructors_in_immutables: warning + prefer_final_locals: warning unnecessary_const: error cancel_subscriptions: error diff --git a/lib/db/files_db.dart b/lib/db/files_db.dart index be292fcf1..5c39a2cc7 100644 --- a/lib/db/files_db.dart +++ b/lib/db/files_db.dart @@ -645,7 +645,7 @@ class FilesDB { inParam = inParam.substring(0, inParam.length - 1); final db = await instance.database; final order = (asc ?? false ? 'ASC' : 'DESC'); - String whereClause = + final String whereClause = '$columnCollectionID IN ($inParam) AND $columnCreationTime >= ? AND ' '$columnCreationTime <= ? AND $columnOwnerID = ?'; final List whereArgs = [startTime, endTime, userID]; diff --git a/lib/ui/home/home_gallery_widget.dart b/lib/ui/home/home_gallery_widget.dart index 5f5074911..57eb99841 100644 --- a/lib/ui/home/home_gallery_widget.dart +++ b/lib/ui/home/home_gallery_widget.dart @@ -27,7 +27,7 @@ class HomeGalleryWidget extends StatelessWidget { @override Widget build(BuildContext context) { - double bottomSafeArea = MediaQuery.of(context).padding.bottom; + final double bottomSafeArea = MediaQuery.of(context).padding.bottom; final gallery = Gallery( asyncLoader: (creationStartTime, creationEndTime, {limit, asc}) async { final ownerID = Configuration.instance.getUserID(); diff --git a/lib/ui/viewer/file/fading_app_bar.dart b/lib/ui/viewer/file/fading_app_bar.dart index 39bd20800..b00af9628 100644 --- a/lib/ui/viewer/file/fading_app_bar.dart +++ b/lib/ui/viewer/file/fading_app_bar.dart @@ -505,7 +505,7 @@ class FadingAppBarState extends State { await dialog.show(); try { final io.File fileToSave = await getFile(file); - var m = MediaExtension(); + final m = MediaExtension(); final bool result = await m.setAs("file://${fileToSave.path}", "image/*"); if (result == false) { showShortToast(context, "Something went wrong"); diff --git a/lib/ui/viewer/file/fading_bottom_bar.dart b/lib/ui/viewer/file/fading_bottom_bar.dart index 9ecf94326..2b8a76b29 100644 --- a/lib/ui/viewer/file/fading_bottom_bar.dart +++ b/lib/ui/viewer/file/fading_bottom_bar.dart @@ -91,7 +91,7 @@ class FadingBottomBarState extends State { if (widget.file is TrashFile) { _addTrashOptions(children); } - bool isUploadedByUser = widget.file.uploadedFileID != null && + final bool isUploadedByUser = widget.file.uploadedFileID != null && widget.file.ownerID == Configuration.instance.getUserID(); bool isFileHidden = false; if (isUploadedByUser) { From bd0eec2e457262f2b42f4e163e6c0c436741884f Mon Sep 17 00:00:00 2001 From: Neeraj Gupta <254676+ua741@users.noreply.github.com> Date: Sun, 6 Nov 2022 14:16:16 +0530 Subject: [PATCH 6/6] Disable linter on draft pr --- .github/workflows/code_quality.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code_quality.yml index b123a4ebe..2620f6410 100644 --- a/.github/workflows/code_quality.yml +++ b/.github/workflows/code_quality.yml @@ -5,6 +5,7 @@ on: - master jobs: test: + if: github.event.pull_request.draft == 'false' name: Check the source code runs-on: ubuntu-latest steps: