diff --git a/app/assets/javascripts/preferences/panes/Extensions.tsx b/app/assets/javascripts/preferences/panes/Extensions.tsx
index 5bf8b8f01..9fdb73d12 100644
--- a/app/assets/javascripts/preferences/panes/Extensions.tsx
+++ b/app/assets/javascripts/preferences/panes/Extensions.tsx
@@ -1,4 +1,4 @@
-import { ContentType, SNComponent } from '@standardnotes/snjs';
+import { ButtonType, ContentType, SNComponent } from '@standardnotes/snjs';
import { Button } from '@/components/Button';
import { DecoratedInput } from '@/components/DecoratedInput';
import { WebApplication } from '@/ui_models/application';
@@ -35,8 +35,22 @@ export const Extensions: FunctionComponent<{
}, [confirmableExtension, confirmableEnd]);
const uninstallExtension = async (extension: SNComponent) => {
- await application.deleteItem(extension);
- setExtensions(loadExtensions(application));
+ application.alertService.confirm(
+ 'Are you sure you want to uninstall this extension? Note that extensions managed by your subscription will automatically be re-installed on application restart.',
+ 'Uninstall Extension?',
+ 'Uninstall',
+ ButtonType.Danger,
+ 'Cancel'
+ )
+ .then(async (shouldRemove: boolean) => {
+ if (shouldRemove) {
+ await application.deleteItem(extension);
+ setExtensions(loadExtensions(application));
+ }
+ })
+ .catch((err: string) => {
+ application.alertService.alert(err);
+ });
};
const submitExtensionUrl = async (url: string) => {
@@ -72,50 +86,51 @@ export const Extensions: FunctionComponent<{
return (
{visibleExtensions.length > 0 &&
-
- {
- visibleExtensions
- .sort((e1, e2) => e1.name.toLowerCase().localeCompare(e2.name.toLowerCase()))
- .map((extension, i) => (
-
- ))
- }
-
+
+ {
+ visibleExtensions
+ .sort((e1, e2) => e1.name.toLowerCase().localeCompare(e2.name.toLowerCase()))
+ .map((extension, i) => (
+
+ ))
+ }
+
}
{!confirmableExtension &&
-
- Install Custom Extension
-
- { setCustomUrl(value); }}
- />
-
-
+
+ Install Custom Extension
+
+ { setCustomUrl(value); }}
+ />
+
+
}
{confirmableExtension &&
-
-
-
-
+
+
+
+
}
diff --git a/app/assets/javascripts/preferences/panes/extensions-segments/ExtensionItem.tsx b/app/assets/javascripts/preferences/panes/extensions-segments/ExtensionItem.tsx
index 445fe7ce3..8ca9bd90b 100644
--- a/app/assets/javascripts/preferences/panes/extensions-segments/ExtensionItem.tsx
+++ b/app/assets/javascripts/preferences/panes/extensions-segments/ExtensionItem.tsx
@@ -101,7 +101,6 @@ export const ExtensionItem: FunctionComponent =
};
const localInstallable = extension.package_info.download_url;
- const isExternal = !extension.package_info.identifier.startsWith('org.standardnotes.');
const installedVersion = extension.package_info.version;
const isToggleable = [ComponentArea.EditorStack, ComponentArea.TagsList].includes(extension.area);
@@ -120,24 +119,22 @@ export const ExtensionItem: FunctionComponent =
{localInstallable && }
{localInstallable && }
- {(isToggleable || isExternal) &&
- <>
-
-
- {isToggleable && (
- <>
- {(extension.active ? (
-
- >
- }
+ <>
+
+
+ {isToggleable && (
+ <>
+ {(extension.active ? (
+
toggleActivate!(extension)} />
+ ) : (
+ toggleActivate!(extension)} />
+ ))}
+
+ >
+ )}
+ uninstall(extension)} />
+
+ >
);
};