Skip to content

Commit

Permalink
Show "detecting" message in flyout before first refresh starts
Browse files Browse the repository at this point in the history
  • Loading branch information
xanderfrangos committed Dec 13, 2023
1 parent 0e2751f commit 657a5ec
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/components/BrightnessPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ export default class BrightnessPanel extends PureComponent {
update: false,
sleeping: false,
updateProgress: 0,
isRefreshing: false
isRefreshing: window.isRefreshing
}
this.lastLevels = []
this.updateInterval = null
Expand Down
9 changes: 5 additions & 4 deletions src/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -1540,7 +1540,7 @@ function tryVibrancy(window, value = null) {
//
//

let isRefreshing = false
let isRefreshing = true
let shouldShowPanel = false
const setIsRefreshing = newValue => {
isRefreshing = (newValue ? true : false)
Expand Down Expand Up @@ -2139,7 +2139,7 @@ ipcMain.on('get-window-history', () => sendToAllWindows('window-history', window
let panelState = "hidden"
let panelReady = false

function createPanel(toggleOnLoad = false) {
function createPanel(toggleOnLoad = false, isRefreshing = false) {

console.log("Creating panel...")

Expand Down Expand Up @@ -2175,7 +2175,8 @@ function createPanel(toggleOnLoad = false) {
zoomFactor: 1.0,
additionalArguments: ["jsVars" + Buffer.from(JSON.stringify({
appName: app.name,
appVersion: app.getVersion()
appVersion: app.getVersion(),
isRefreshing: isRefreshing
})).toString('base64')],
allowRunningInsecureContent: true,
webSecurity: false
Expand Down Expand Up @@ -2739,7 +2740,7 @@ app.on("ready", async () => {
//readSettings()
getLocalization()
showIntro()
createPanel()
createPanel(false, true)

startMonitorThread()
monitorsThread.once("ready", async () => {
Expand Down
7 changes: 6 additions & 1 deletion src/panel-preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ console.error = (...e) => { e.forEach((c) => { ipc.send('log', c); con.error(c)

window.winPosition = { x: 0, y: 0, width: 0, height: 0 }

let jsVars
function getArgumentVars() {
try {
if(jsVars) return jsVars;

const jsVarsString = process.argv.find(arg => arg.indexOf("jsVars") === 0)
const jsVars = JSON.parse(atob(jsVarsString.substring(6)))
jsVars = JSON.parse(atob(jsVarsString.substring(6)))
return jsVars
} catch(e) {
return {}
Expand Down Expand Up @@ -441,4 +444,6 @@ window.showPanel = false
window.isAcrylic = false
window.theme = "dark"
window.settings = {}
window.jsVars = getArgumentVars()
window.isRefreshing = getArgumentVars().isRefreshing
window.isAppX = (getArgumentVars().appName == "twinkle-tray-appx" ? true : false)

0 comments on commit 657a5ec

Please sign in to comment.