Small fixes

This commit is contained in:
crschnick
2024-06-19 16:00:45 +00:00
parent 1f7174db86
commit 914f724577
2 changed files with 3 additions and 2 deletions
@@ -12,6 +12,7 @@ import io.xpipe.core.util.XPipeInstallation;
import lombok.Getter;
import java.io.IOException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
@@ -110,7 +111,7 @@ public class AppBeaconServer {
}
private void start() throws IOException {
server = HttpServer.create(new InetSocketAddress("localhost", port), 10);
server = HttpServer.create(new InetSocketAddress(InetAddress.getLoopbackAddress(), port), 10);
BeaconInterface.getAll().forEach(beaconInterface -> {
server.createContext(beaconInterface.getPath(), new BeaconRequestHandler<>(beaconInterface));
});
@@ -54,7 +54,7 @@ public class MarkdownComp extends Comp<CompStructure<StackPane>> {
.setUserDataDirectory(
AppProperties.get().getDataDir().resolve("webview").toFile());
wv.setPageFill(Color.TRANSPARENT);
var theme = AppPrefs.get() != null && AppPrefs.get().theme.getValue().isDark()
var theme = AppPrefs.get() != null && AppPrefs.get().theme.getValue() != null && AppPrefs.get().theme.getValue().isDark()
? "misc/github-markdown-dark.css"
: "misc/github-markdown-light.css";
var url = AppResources.getResourceURL(AppResources.XPIPE_MODULE, theme).orElseThrow();