feat(plugins): install marketplace packages via dbx deep link
This commit is contained in:
18 files changed
+223
-1
No files matched your search
@@ -25,6 +25,7 @@ import { useI18n } from "vue-i18n";
|
||||
|
||||
const props = defineProps<{
|
||||
focusTarget?: PluginCenterFocus | null;
|
||||
installUrlRequest?: { id: number; url: string } | null;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
@@ -534,6 +535,21 @@ watch(
|
||||
},
|
||||
{ deep: true },
|
||||
);
|
||||
let lastHandledInstallRequestId = 0;
|
||||
watch(
|
||||
() => props.installUrlRequest,
|
||||
async (request) => {
|
||||
// immediate so a deep link that just opened the Plugin Center is consumed on
|
||||
// mount; the id guard keeps already-handled requests from replaying.
|
||||
if (!request || request.id <= lastHandledInstallRequestId) return;
|
||||
lastHandledInstallRequestId = request.id;
|
||||
installUrl.value = request.url;
|
||||
if (window.confirm(t("pluginPlatform.deepLinkInstallConfirm", { url: request.url }))) {
|
||||
await installPluginFromUrl();
|
||||
}
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
watch(allowUnsigned, (value) => {
|
||||
try {
|
||||
localStorage.setItem(PLUGIN_ALLOW_UNSIGNED_STORAGE_KEY, value ? "1" : "0");
|
||||
|
||||
Reference in new issue
Block a user