File tree Expand file tree Collapse file tree 2 files changed +14
-13
lines changed
src/Files.App/Actions/Start Expand file tree Collapse file tree 2 files changed +14
-13
lines changed Original file line number Diff line number Diff line change 11// Copyright (c) 2024 Files Community
22// Licensed under the MIT License. See the LICENSE.
33
4- using CommunityToolkit . Mvvm . DependencyInjection ;
5- using Files . Core . Storage ;
6-
74namespace Files . App . Actions
85{
96 internal sealed class PinToStartAction : IAction
@@ -45,15 +42,18 @@ await SafetyExtensions.IgnoreExceptions(async () =>
4542 _ => await StorageService . GetFileAsync ( ( listedItem as ShortcutItem ) ? . TargetPath ?? listedItem . ItemPath )
4643 } ;
4744 await StartMenuService . PinAsync ( storable , listedItem . Name ) ;
48- } ) ;
45+ } ) ;
4946 }
5047 }
5148 else if ( context . ShellPage ? . ShellViewModel ? . CurrentFolder is not null )
5249 {
53- var currentFolder = context . ShellPage . ShellViewModel . CurrentFolder ;
54- var folder = await StorageService . GetFolderAsync ( currentFolder . ItemPath ) ;
50+ await SafetyExtensions . IgnoreExceptions ( async ( ) =>
51+ {
52+ var currentFolder = context . ShellPage . ShellViewModel . CurrentFolder ;
53+ var folder = await StorageService . GetFolderAsync ( currentFolder . ItemPath ) ;
5554
56- await StartMenuService . PinAsync ( folder , currentFolder . Name ) ;
55+ await StartMenuService . PinAsync ( folder , currentFolder . Name ) ;
56+ } ) ;
5757 }
5858 }
5959 }
Original file line number Diff line number Diff line change 11// Copyright (c) 2024 Files Community
22// Licensed under the MIT License. See the LICENSE.
33
4- using Files . Core . Storage ;
5-
64namespace Files . App . Actions
75{
86 internal sealed class UnpinFromStartAction : IAction
@@ -41,15 +39,18 @@ await SafetyExtensions.IgnoreExceptions(async () =>
4139 _ => await StorageService . GetFileAsync ( ( listedItem as ShortcutItem ) ? . TargetPath ?? listedItem . ItemPath )
4240 } ;
4341 await StartMenuService . UnpinAsync ( storable ) ;
44- } ) ;
42+ } ) ;
4543 }
4644 }
4745 else
4846 {
49- var currentFolder = context . ShellPage . ShellViewModel . CurrentFolder ;
50- var folder = await StorageService . GetFolderAsync ( currentFolder . ItemPath ) ;
47+ await SafetyExtensions . IgnoreExceptions ( async ( ) =>
48+ {
49+ var currentFolder = context . ShellPage . ShellViewModel . CurrentFolder ;
50+ var folder = await StorageService . GetFolderAsync ( currentFolder . ItemPath ) ;
5151
52- await StartMenuService . UnpinAsync ( folder ) ;
52+ await StartMenuService . UnpinAsync ( folder ) ;
53+ } ) ;
5354 }
5455 }
5556 }
You can’t perform that action at this time.
0 commit comments