move stylesheet injection to App component to eliminate FOUC on static rendering

This commit is contained in:
sbwalker
2024-02-20 10:16:19 -05:00
parent 4fad97e8b1
commit 0f0d168976
4 changed files with 103 additions and 55 deletions

View File

@ -32,8 +32,8 @@ namespace Oqtane.Models
PathAndQuery = uri.PathAndQuery;
AliasPath = aliaspath;
PagePath = AbsolutePath;
ModuleId = "";
Action = "";
ModuleId = "-1";
Action = Constants.DefaultAction;
UrlParameters = "";
if (AliasPath.Length != 0 && PagePath.StartsWith("/" + AliasPath))
@ -50,6 +50,7 @@ namespace Oqtane.Models
if (pos != -1)
{
ModuleId = PagePath.Substring(pos + 3);
ModuleId = (int.TryParse(ModuleId, out _)) ? ModuleId : "-1";
PagePath = PagePath.Substring(0, pos);
}
if (ModuleId.Length != 0)
@ -57,8 +58,10 @@ namespace Oqtane.Models
pos = ModuleId.IndexOf("/");
if (pos != -1)
{
Action = ModuleId.Substring(pos + 1);
Action = ModuleId.Substring(pos + 1);
Action = (!string.IsNullOrEmpty(Action)) ? Action : Constants.DefaultAction;
ModuleId = ModuleId.Substring(0, pos);
ModuleId = (int.TryParse(ModuleId, out _)) ? ModuleId : "-1";
}
}
if (PagePath.StartsWith("/"))