mirror of
https://github.com/flarum/core.git
synced 2025-07-30 13:10:24 +02:00
Add ability to uninstall an extension
This commit is contained in:
@@ -82,12 +82,20 @@ export default class ExtensionsPage extends Component {
|
||||
}
|
||||
}));
|
||||
|
||||
// if (!enabled) {
|
||||
// items.add('uninstall', Button.component({
|
||||
// icon: 'trash-o',
|
||||
// children: 'Uninstall'
|
||||
// }));
|
||||
// }
|
||||
if (!enabled) {
|
||||
items.add('uninstall', Button.component({
|
||||
icon: 'trash-o',
|
||||
children: 'Uninstall',
|
||||
onclick: () => {
|
||||
app.request({
|
||||
url: app.forum.attribute('apiUrl') + '/extensions/' + extension.name,
|
||||
method: 'DELETE',
|
||||
}).then(() => window.location.reload());
|
||||
|
||||
app.modal.show(new LoadingModal());
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
// items.add('separator2', Separator.component());
|
||||
|
||||
|
Reference in New Issue
Block a user