Skip to content

Commit 35867a0

Browse files
authored
Merge pull request #3999 from Flow-Launcher/portable_mode_fix
Fix PortableMode Check Issue
2 parents d7e1ad7 + 6fca1c9 commit 35867a0

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Flow.Launcher.Infrastructure/UserSettings/DataLocation.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ public static class DataLocation
77
{
88
public const string PortableFolderName = "UserData";
99
public const string DeletionIndicatorFile = ".dead";
10-
public static string PortableDataPath = Path.Combine(Constant.ProgramDirectory, PortableFolderName);
11-
public static string RoamingDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "FlowLauncher");
10+
public static readonly string PortableDataPath = Path.Combine(Constant.ProgramDirectory, PortableFolderName);
11+
public static readonly string RoamingDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "FlowLauncher");
1212
public static string DataDirectory()
1313
{
1414
if (PortableDataLocationInUse())
@@ -19,7 +19,8 @@ public static string DataDirectory()
1919

2020
public static bool PortableDataLocationInUse()
2121
{
22-
if (Directory.Exists(PortableDataPath) && !File.Exists(DeletionIndicatorFile))
22+
if (Directory.Exists(PortableDataPath) &&
23+
!File.Exists(Path.Combine(PortableDataPath, DeletionIndicatorFile)))
2324
return true;
2425

2526
return false;

Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public List<int> ScreenNumbers
123123
}
124124

125125
// This is only required to set at startup. When portable mode enabled/disabled a restart is always required
126-
private static bool _portableMode = DataLocation.PortableDataLocationInUse();
126+
private static readonly bool _portableMode = DataLocation.PortableDataLocationInUse();
127127

128128
public bool PortableMode
129129
{

0 commit comments

Comments
 (0)