diff --git a/lib/main.dart b/lib/main.dart index 5dbb6ae3..a492d78b 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -18,7 +18,6 @@ import 'package:path_provider/path_provider.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:picture_in_picture/picture_in_picture.dart'; -import 'package:namida/controller/clipboard_controller.dart'; import 'package:namida/controller/connectivity.dart'; import 'package:namida/controller/current_color.dart'; import 'package:namida/controller/folders_controller.dart'; @@ -117,7 +116,7 @@ void main() async { Language.initialize(), ]); ConnectivityController.inst.initialize(); - ClipboardController.inst.setClipboardMonitoringStatus(settings.enableClipboardMonitoring.value); + LifeCycleController.inst.setCanEnterPip(settings.enablePip.value); /// updates values on startup Indexer.inst.updateImageSizeInStorage(); diff --git a/lib/ui/pages/main_page.dart b/lib/ui/pages/main_page.dart index e29eb561..d2ee8df4 100644 --- a/lib/ui/pages/main_page.dart +++ b/lib/ui/pages/main_page.dart @@ -323,8 +323,10 @@ class NamidaSearchBar extends StatelessWidget { ClipboardController.inst.updateTextInControllerEmpty(true); if (isOpen) { SearchSortController.inst.prepareResources(); + ClipboardController.inst.setClipboardMonitoringStatus(settings.enableClipboardMonitoring.value); } else { SearchSortController.inst.disposeResources(); + ClipboardController.inst.setClipboardMonitoringStatus(false); } }, onFieldSubmitted: _onSubmitted, diff --git a/lib/ui/widgets/settings/extra_settings.dart b/lib/ui/widgets/settings/extra_settings.dart index 73893ed6..1900348e 100644 --- a/lib/ui/widgets/settings/extra_settings.dart +++ b/lib/ui/widgets/settings/extra_settings.dart @@ -2,7 +2,6 @@ import 'package:flutter/material.dart'; import 'package:get/get.dart'; -import 'package:namida/controller/clipboard_controller.dart'; import 'package:namida/controller/current_color.dart'; import 'package:namida/controller/folders_controller.dart'; import 'package:namida/controller/indexer_controller.dart'; @@ -339,7 +338,6 @@ class ExtrasSettings extends SettingSubpageProvider { value: settings.enableClipboardMonitoring.value, onChanged: (isTrue) { settings.save(enableClipboardMonitoring: !isTrue); - ClipboardController.inst.setClipboardMonitoringStatus(!isTrue); }, ), ),