Console: ensure externalcss is cleared if not available

This commit is contained in:
dr|z3d 2021-09-13 12:22:26 +00:00
parent 98e41c2c05
commit 2cbb6cba26

View file

@ -425,17 +425,17 @@ namespace http {
std::ifstream f(styleFile, std::ifstream::binary); std::ifstream f(styleFile, std::ifstream::binary);
s << f.rdbuf(); s << f.rdbuf();
externalCSS = s.str(); externalCSS = s.str();
} else if (externalCSS.length() != 0) { // clean up external style if file was removed
externalCSS = "";
} }
} }
static void GetStyles (std::stringstream& s) static void GetStyles (std::stringstream& s)
{ {
if (externalCSS.length() != 0) { if (externalCSS.length() != 0)
s << "<style>\r\n" << externalCSS << "</style>\r\n"; s << "<style>\r\n" << externalCSS << "</style>\r\n";
} else { else
s << internalCSS; s << internalCSS;
externalCSS = "";
}
} }
const char HTTP_PAGE_TUNNEL_SUMMARY[] = "tunnel_summary"; const char HTTP_PAGE_TUNNEL_SUMMARY[] = "tunnel_summary";