Skip to content

Commit

Permalink
refactor: moved root path into a constant
Browse files Browse the repository at this point in the history
  • Loading branch information
MetalHexx committed Mar 9, 2024
1 parent 9eba883 commit b0a1fbe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
public static class StorageConstants
{
public const string Cache_File_Path = @"Assets\System\Cache\Cache.json";
public const string Remote_Path_Root = @"/";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using TeensyRom.Core.Serial.State;
using TeensyRom.Core.Settings;
using TeensyRom.Core.Storage.Entities;
using TeensyRom.Core.Storage.Services;
using TeensyRom.Ui.Controls.CornerToolbar;
using TeensyRom.Ui.Controls.DirectoryChips;
using TeensyRom.Ui.Controls.DirectoryList;
Expand Down Expand Up @@ -143,11 +144,13 @@ public DiscoverViewModel(IDiscoverContext context, ISerialStateContext serial, I

var libPath = s.Libraries.FirstOrDefault(l => l.Type == _viewConfig.LibraryType)?.Path ?? "";

DirectoryChips = new DirectoryChipsViewModel(
DirectoryChips = new DirectoryChipsViewModel
(
path: context.CurrentPath,
basePath: "/",
basePath: StorageConstants.Remote_Path_Root,
onClick: async path => await context.LoadDirectory(path),
onCopy: () => alert.Publish("Path copied to clipboard"));
onCopy: () => alert.Publish("Path copied to clipboard")
);

CornerToolbar = new CornerToolbarViewModel
(
Expand Down

0 comments on commit b0a1fbe

Please sign in to comment.