mirror of
https://github.com/ragestudio/relic.git
synced 2025-06-09 02:24:18 +00:00
use location hash to set log mode
This commit is contained in:
parent
e187a49947
commit
faed0d8754
@ -44,9 +44,11 @@ class LogsViewer {
|
||||
})
|
||||
|
||||
if (is.dev && process.env["ELECTRON_RENDERER_URL"]) {
|
||||
this.window.loadURL(`${process.env["ELECTRON_RENDERER_URL"]}/logs`)
|
||||
this.window.loadURL(`${process.env["ELECTRON_RENDERER_URL"]}/#logs`)
|
||||
} else {
|
||||
this.window.loadFile(path.join(__dirname, "../renderer/index.html"))
|
||||
this.window.loadFile(path.join(__dirname, "../renderer/index.html"), {
|
||||
hash: "#logs",
|
||||
})
|
||||
}
|
||||
|
||||
await new Promise((resolve) => this.window.once("ready-to-show", resolve))
|
||||
@ -99,6 +101,10 @@ class ElectronApp {
|
||||
|
||||
this.adapter.attachLogger(loggerWindow)
|
||||
|
||||
loggerWindow.on("closed", () => {
|
||||
this.adapter.detachLogger()
|
||||
})
|
||||
|
||||
loggerWindow.webContents.send("logger:new", {
|
||||
timestamp: new Date().getTime(),
|
||||
message: "Logger opened, starting watching logs",
|
||||
|
@ -103,8 +103,7 @@ class App extends React.Component {
|
||||
console.log(`React version > ${versions["react"]}`)
|
||||
console.log(`DOMRouter version > ${versions["react-router-dom"]}`)
|
||||
|
||||
//check if path is /logs
|
||||
if (window.location.pathname === "/logs") {
|
||||
if (window.location.hash === "#logs") {
|
||||
return await this.setState({
|
||||
initializing: false,
|
||||
no_layout: true,
|
||||
|
Loading…
x
Reference in New Issue
Block a user