Skip to content

Commit 35489d3

Browse files
committed
refactor(plugins): migrate plugin update alerts to notification system
- Replace header icon indicator with notification-based alerts in case of plugin alerts - Remove legacy plugin update icon from header UI
1 parent d1575f4 commit 35489d3

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

src/lib/main.js

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -380,25 +380,16 @@ async function loadApp() {
380380
checkPluginsUpdate()
381381
.then((updates) => {
382382
if (!updates.length) return;
383-
const $icon = (
384-
<span
385-
onclick={() => {
383+
acode.pushNotification(
384+
"Plugin Updates",
385+
`${updates.length} plugin${updates.length > 1 ? "s" : ""} ${updates.length > 1 ? "have" : "has"} new version${updates.length > 1 ? "s" : ""} available.`,
386+
{
387+
icon: "extension",
388+
action: () => {
386389
plugins(updates);
387-
$icon.remove();
388-
}}
389-
attr-action=""
390-
style={{ fontSize: "1.2rem" }}
391-
className="icon notifications"
392-
></span>
390+
},
391+
},
393392
);
394-
395-
if ($editMenuToggler.isConnected) {
396-
$header.insertBefore($icon, $editMenuToggler);
397-
} else if ($runBtn.isConnected) {
398-
$header.insertBefore($icon, $runBtn);
399-
} else {
400-
$header.insertBefore($icon, $menuToggler);
401-
}
402393
})
403394
.catch(console.error);
404395

0 commit comments

Comments
 (0)