mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-05 19:24:39 +00:00
feat: performance improvements to profile picture plugin
This commit is contained in:
@@ -69,11 +69,12 @@ const profilePicturePlugin: Plugin<typeof settings> = {
|
||||
// Initial load
|
||||
await updateImageFromStore();
|
||||
|
||||
// Listen for storage changes (in case user updates from settings)
|
||||
const interval = setInterval(updateImageFromStore, 1000);
|
||||
// Listen for profile picture updates
|
||||
const handler = () => { updateImageFromStore(); };
|
||||
window.addEventListener('profile-picture-updated', handler);
|
||||
|
||||
return () => {
|
||||
clearInterval(interval);
|
||||
window.removeEventListener('profile-picture-updated', handler);
|
||||
if (img) img.remove();
|
||||
if (svg) svg.style.display = "";
|
||||
if (currentBlobUrl) URL.revokeObjectURL(currentBlobUrl);
|
||||
|
||||
Reference in New Issue
Block a user