Fix broken Value
This commit is contained in:
parent
1d4fcf2bb5
commit
735dc9e5f2
1 changed files with 55 additions and 55 deletions
|
|
@ -142,7 +142,7 @@ function UserPluginsTab() {
|
|||
return "Invalid URL, read the notice above";
|
||||
}
|
||||
}}
|
||||
value={url}
|
||||
initialValue={url}
|
||||
/>
|
||||
</div>
|
||||
<div className={cl("button-container")}>
|
||||
|
|
@ -251,61 +251,61 @@ function UserPluginsTab() {
|
|||
{Object.keys(
|
||||
pluginsWithUpdates,
|
||||
).includes(plugin.directory!) && (
|
||||
<Button
|
||||
size="small"
|
||||
onClick={async () => {
|
||||
try {
|
||||
await Native.updatePlugin(
|
||||
plugin.directory!,
|
||||
);
|
||||
const oldPWU =
|
||||
userpluginInstaller.pluginsWithUpdates.value()
|
||||
.plugins;
|
||||
oldPWU.splice(
|
||||
oldPWU.indexOf(
|
||||
<Button
|
||||
size="small"
|
||||
onClick={async () => {
|
||||
try {
|
||||
await Native.updatePlugin(
|
||||
plugin.directory!,
|
||||
),
|
||||
1,
|
||||
);
|
||||
userpluginInstaller.pluginsWithUpdates.value(
|
||||
{
|
||||
finished: true,
|
||||
plugins: oldPWU,
|
||||
},
|
||||
);
|
||||
Alerts.show({
|
||||
title: "Done!",
|
||||
body: `${plugin.name} has been updated. A ${plugin.usesNative ? "restart" : "refresh"} is needed to apply the update.`,
|
||||
confirmText:
|
||||
plugin.usesNative
|
||||
? "Restart"
|
||||
: "Refresh",
|
||||
cancelText: "Later",
|
||||
onConfirm() {
|
||||
plugin.usesNative
|
||||
? relaunch()
|
||||
: window.location.reload();
|
||||
},
|
||||
});
|
||||
} catch (e: any) {
|
||||
if (
|
||||
e
|
||||
.toString()
|
||||
.includes(
|
||||
"silentStop",
|
||||
)
|
||||
)
|
||||
return;
|
||||
Alerts.show({
|
||||
title: "Update error",
|
||||
body: e.toString(),
|
||||
});
|
||||
}
|
||||
}}
|
||||
>
|
||||
Update
|
||||
</Button>
|
||||
)}
|
||||
);
|
||||
const oldPWU =
|
||||
userpluginInstaller.pluginsWithUpdates.value()
|
||||
.plugins;
|
||||
oldPWU.splice(
|
||||
oldPWU.indexOf(
|
||||
plugin.directory!,
|
||||
),
|
||||
1,
|
||||
);
|
||||
userpluginInstaller.pluginsWithUpdates.value(
|
||||
{
|
||||
finished: true,
|
||||
plugins: oldPWU,
|
||||
},
|
||||
);
|
||||
Alerts.show({
|
||||
title: "Done!",
|
||||
body: `${plugin.name} has been updated. A ${plugin.usesNative ? "restart" : "refresh"} is needed to apply the update.`,
|
||||
confirmText:
|
||||
plugin.usesNative
|
||||
? "Restart"
|
||||
: "Refresh",
|
||||
cancelText: "Later",
|
||||
onConfirm() {
|
||||
plugin.usesNative
|
||||
? relaunch()
|
||||
: window.location.reload();
|
||||
},
|
||||
});
|
||||
} catch (e: any) {
|
||||
if (
|
||||
e
|
||||
.toString()
|
||||
.includes(
|
||||
"silentStop",
|
||||
)
|
||||
)
|
||||
return;
|
||||
Alerts.show({
|
||||
title: "Update error",
|
||||
body: e.toString(),
|
||||
});
|
||||
}
|
||||
}}
|
||||
>
|
||||
Update
|
||||
</Button>
|
||||
)}
|
||||
<Button
|
||||
variant="secondary"
|
||||
size="small"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue