Skip to content

Commit

Permalink
ui: add mtime to image urls to avoid caching
Browse files Browse the repository at this point in the history
  • Loading branch information
shagu committed Feb 3, 2024
1 parent e6ecd4f commit 705c8a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/renderer/ui/ui-window-content-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,10 @@ export default class UIWindowContentCard extends HTMLElement {

const image = document.createElement('img')
image.setAttribute('id', 'image')
image.setAttribute('src', card.fsurl)

image.src = card.fsurl
if (card.mtime) image.src += '?d=' + card.mtime

this.shadow.appendChild(image)

const title = document.createElement('div')
Expand Down
1 change: 1 addition & 0 deletions src/renderer/ui/ui-window-sidebar-single.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ export default class UIWindowSidebarSingle extends HTMLElement {

if (card && card.metadata) {
this.dom.image.src = card.preview || card.fsurl
if (card.mtime) this.dom.image.src += '?d=' + card.mtime

const name = macaco.getLocale(card, 'name') || 'Unknown Card'
const type = macaco.getLocale(card, 'type')
Expand Down

0 comments on commit 705c8a6

Please sign in to comment.