Skip to content

Commit

Permalink
[plugins] fix auto updates not actually being disabled (oh no)
Browse files Browse the repository at this point in the history
  • Loading branch information
ioj4 committed Feb 24, 2024
1 parent 43575ed commit 2ba0f29
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/shelter/src/components/PluginAddModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export default (props: { close(): void }) => {
} catch (e) {}
} else {
try {
await addRemotePlugin(newId(), rSrc());
await addRemotePlugin(newId(), rSrc(), rUpdate());
} catch (e) {}
}
}}
Expand Down
4 changes: 2 additions & 2 deletions packages/shelter/src/plugins.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ async function updatePlugin(pluginId: string) {
if (!data) throw new Error(`attempted to update a non-existent plugin: ${pluginId}`);
if (internalLoaded[pluginId]) throw new Error(`attempted to update a loaded plugin: ${pluginId}`);

if (data.update && data.src) {
if (data.src) {
try {
const newPluginManifest = await (await fetch(new URL("plugin.json", data.src), { cache: "no-store" })).json();

Expand Down Expand Up @@ -173,7 +173,7 @@ export async function startAllPlugins() {
const allPlugins = Object.keys(internalData);

// update in parallel
const results = await Promise.allSettled(allPlugins.map(updatePlugin));
const results = await Promise.allSettled(allPlugins.filter((id) => internalData[id].update).map(updatePlugin));

for (const res of results) if (res.status === "rejected") log(res.reason, "error");

Expand Down

0 comments on commit 2ba0f29

Please sign in to comment.