Skip to content

Commit

Permalink
fix: show git hash in info box
Browse files Browse the repository at this point in the history
  • Loading branch information
SpikeHD committed Oct 28, 2024
1 parent a6ecf74 commit e9bf91b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugins/dorion-settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const settingsUninjects = [
const appendAppVersion = async () => {
let tries = 0
const infoBoxSelector = 'div[class*="side_"] div[class*="info_"]'
const hash = await invoke('git_hash').catch((e) => console.error(e)) || ''

// Wait for infoBox to exist
while (!document.querySelector(infoBoxSelector)) {
Expand All @@ -51,6 +52,11 @@ const appendAppVersion = async () => {
if (!firstChild) return

newVersionThing.innerHTML = `${appName} v${await app.getVersion()}`

if (hash) {
newVersionThing.innerHTML += ' - ' + hash.slice(0, 7)
}

// @ts-expect-error This works
newVersionThing.classList.add(...firstChild.classList)
newVersionThing.style.color = firstChild.style.color
Expand Down

0 comments on commit e9bf91b

Please sign in to comment.